spoolss: add idl for spoolss_RpcSendRecvBidiData.
[obnox/samba/samba-obnox.git] / librpc / idl / spoolss.idl
index 48162097ccbd9f0c1650e7936cc786ae9dccdabe..c143733fcc653522d35ebe153da6dd2a9851615e 100644 (file)
@@ -17,7 +17,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 ] interface spoolss
 {
        typedef [v1_enum] enum winreg_Type winreg_Type;
-       typedef [gensize] struct {
+       typedef [gensize,noprint] struct {
                uint16 year;
                uint16 month;
                uint16 day_of_week;
@@ -29,17 +29,19 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        } spoolss_Time;
 
        typedef struct {
-               [value(ndr_size_spoolss_Time(time, ndr->iconv_convenience, ndr->flags))] uint32 size;
+               [value(ndr_size_spoolss_Time(time, ndr->flags))] uint32 size;
                [unique] spoolss_Time *time;
        } spoolss_TimeCtr;
 
        typedef enum {
                PROCESSOR_ARCHITECTURE_INTEL            = 0x0000,
+               PROCESSOR_ARCHITECTURE_ARM              = 0x0005,
                PROCESSOR_ARCHITECTURE_IA64             = 0x0006,
                PROCESSOR_ARCHITECTURE_AMD64            = 0x0009
        } spoolss_ProcessorArchitecture;
 
        typedef [v1_enum] enum {
+               PROCESSOR_ARM                           = 0x00000000,
                PROCESSOR_INTEL_386                     = 0x00000182,
                PROCESSOR_INTEL_486                     = 0x000001E6,
                PROCESSOR_INTEL_PENTIUM                 = 0x0000024A,
@@ -119,6 +121,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                JOB_STATUS_COMPLETE             = 0x00001000
        } spoolss_JobStatus;
 
+       typedef [v1_enum] enum {
+               SPOOLSS_DEBUGGING_BUILD         = 0x00000000,
+               SPOOLSS_RELEASE_BUILD           = 0x00000001
+       } spoolss_Build;
+
        typedef [public,gensize] struct {
                [relative] nstring *printername;
                [relative] nstring *servername;
@@ -129,7 +136,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 global_counter;
                uint32 total_pages;
                uint32 version;
-               uint32 free_build;
+               spoolss_Build free_build;
                uint32 spooling;
                uint32 max_spooling;
                uint32 session_counter;
@@ -151,6 +158,305 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 reserved3;
        } spoolss_PrinterInfo0;
 
+       /* Device Mode Extra Data */
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA        = 0x554e4944, /* 0x44494e55 */
+               SPOOLSS_DM_SIGNATURE_JTEXP              = 0x4a544d53, /* 0x534d544a */
+               SPOOLSS_DM_SIGNATURE_PSEXTRA            = 0x50524956 /* 0x56495250 */
+       } spoolss_DM_Signature;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_LAYOUT_NUP_DISABLED          = 0x00000000,
+               SPOOLSS_DM_LAYOUT_NUP_2                 = 0x00000001,
+               SPOOLSS_DM_LAYOUT_NUP_4                 = 0x00000002,
+               SPOOLSS_DM_LAYOUT_NUP_6                 = 0x00000003,
+               SPOOLSS_DM_LAYOUT_NUP_9                 = 0x00000004,
+               SPOOLSS_DM_LAYOUT_NUP_16                = 0x00000005,
+               SPOOLSS_DM_LAYOUT_BOOKLET               = 0x00000006
+       } spoolss_DM_Layout;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_NUP_DIRECTION_L2R_T2B        = 0x00000001,
+               SPOOLSS_DM_NUP_DIRECTION_T2B_L2R        = 0x00000002,
+               SPOOLSS_DM_NUP_DIRECTION_R2L_T2B        = 0x00000004,
+               SPOOLSS_DM_NUP_DIRECTION_T2B_R2L        = 0x00000008
+       } spoolss_DM_NupDirection;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_NUP_BORDER_PRINT             = 0x00000000,
+               SPOOLSS_DM_NUP_BORDER_NONE              = 0x00000001
+       } spoolss_DM_NupBorderFlags;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_BOOKLET_LEFT_FLIP            = 0x00000000,
+               SPOOLSS_DM_BOOKLET_RIGHT_FLIP           = 0x00000001
+       } spoolss_DM_BookletFlags;
+
+       /* Device Mode Extra Data: PostScript */
+
+       /* NT 3.51 */
+
+       typedef [bitmap32bit] bitmap {
+               SPOOLSS_DM_PS_FLAGS_DRV_ERROR_HANDLER   = 0x00000002,
+               SPOOLSS_DM_PS_FLAGS_PRINT_MIRROR        = 0x00000004,
+               SPOOLSS_DM_PS_FLAGS_PRINT_NEGATIVE      = 0x00000010,
+               SPOOLSS_DM_PS_FLAGS_COMPRESS_BITMAP     = 0x00000040,
+               SPOOLSS_DM_PS_FLAGS_ROTATE_180          = 0x00000200,
+               SPOOLSS_DM_PS_FLAGS_GDI_METAFILE_SPOOL  = 0x00002000
+       } spoolss_DMPS_Flags;
+
+       typedef struct {
+               [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
+               spoolss_DMPS_Flags dwFlags;
+               uint32 wchEPSFile[12];
+               [value(24)] uint16 caSize;
+               uint16 caFlags;
+               uint16 caIlluminantIndex;
+               uint16 caRedGamma;
+               uint16 caGreenGamma;
+               uint16 caBlueGamma;
+               uint16 caReferenceBlack;
+               uint16 caReferenceWhite;
+               uint16 caContrast;
+               uint16 caBrightness;
+               uint16 caColorfulness;
+               uint16 caRedGreenTint;
+       } spoolss_PSDRVEXTRA351;
+
+       /* NT 4.0 */
+
+       typedef struct {
+               [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
+               spoolss_DMPS_Flags dwFlags;
+               uint32 wchEPSFile[12];
+               [value(24)] uint16 caSize;
+               uint16 caFlags;
+               uint16 caIlluminantIndex;
+               uint16 caRedGamma;
+               uint16 caGreenGamma;
+               uint16 caBlueGamma;
+               uint16 caReferenceBlack;
+               uint16 caReferenceWhite;
+               uint16 caContrast;
+               uint16 caBrightness;
+               uint16 caColorfulness;
+               uint16 caRedGreenTint;
+               uint16 wChecksum;
+               uint16 wOptions;
+               uint32 aubOptions[8];
+       } spoolss_PSDRVEXTRA400;
+
+       /* 2000 & XP */
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_PS_OPTIMIZE_SPEED            = 0x00000000,
+               SPOOLSS_DM_PS_OPTIMIZE_PORTABILITY      = 0x00000001,
+               SPOOLSS_DM_PS_OPTIMIZE_EPS              = 0x00000002,
+               SPOOLSS_DM_PS_OPTIMIZE_ARCHIVAL         = 0x00000003
+       } spoolss_DMPS_Dialect;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_PS_TTDLFMT_DEFAULT           = 0x00000000,
+               SPOOLSS_DM_PS_TTDLFMT_TYPE_1            = 0x00000001,
+               SPOOLSS_DM_PS_TTDLFMT_TYPE_3            = 0x00000002,
+               SPOOLSS_DM_PS_TTDLFMT_TYPE_42           = 0x00000003
+       } spoolss_DMPS_TTDLFmt;
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_PS_PSLEVEL_1 = 0x00000001,
+               SPOOLSS_DM_PS_PSLEVEL_2 = 0x00000002,
+               SPOOLSS_DM_PS_PSLEVEL_3 = 0x00000003
+       } spoolss_DMPS_PSLevel;
+
+       typedef enum {
+               SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST            = 0x0000,
+               SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST           = 0x0001,
+               SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST_UPSIDEDOWN = 0x0002,
+               SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST_UPSIDEDOWN= 0x0003
+       } spoolss_DMPS_FeedDirection;
+
+       typedef struct {
+               [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
+               spoolss_DMPS_Flags dwFlags;
+               uint32 wchEPSFile[12];
+               [value(24)] uint16 caSize;
+               uint16 caFlags;
+               uint16 caIlluminantIndex;
+               uint16 caRedGamma;
+               uint16 caGreenGamma;
+               uint16 caBlueGamma;
+               uint16 caReferenceBlack;
+               uint16 caReferenceWhite;
+               uint16 caContrast;
+               uint16 caBrightness;
+               uint16 caColorfulness;
+               uint16 caRedGreenTint;
+               uint16 wReserved1;
+               uint16 wSize;
+               uint32 fxScrFreq;
+               uint32 fxScrAngle;
+               spoolss_DMPS_Dialect iDialect;
+               spoolss_DMPS_TTDLFmt iTTDLFmt;
+               boolean32 bReversePrint;
+               spoolss_DM_Layout iLayout;
+               spoolss_DMPS_PSLevel iPSLevel;
+               uint32 dwReserved2;
+               uint16 wOEMExtra;
+               [value(0x0010)] uint16 wVer;
+               uint32 dwX;
+               uint32 dwY;
+               uint32 dwWidthOffset;
+               uint32 dwHeightOffset;
+               spoolss_DMPS_FeedDirection wFeedDirection;
+               uint16 wCutSheet;
+               uint32 dwReserved3[4];
+               uint32 dwChecksum32;
+               uint32 dwOptions;
+               uint32 aOptions[128];
+       } spoolss_PSDRVEXTRA500;
+
+       /* Vista, 2008, 7 */
+
+       typedef struct {
+               [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature;
+               spoolss_DMPS_Flags dwFlags;
+               uint32 wchEPSFile[12];
+               [value(24)] uint16 caSize;
+               uint16 caFlags;
+               uint16 caIlluminantIndex;
+               uint16 caRedGamma;
+               uint16 caGreenGamma;
+               uint16 caBlueGamma;
+               uint16 caReferenceBlack;
+               uint16 caReferenceWhite;
+               uint16 caContrast;
+               uint16 caBrightness;
+               uint16 caColorfulness;
+               uint16 caRedGreenTint;
+               uint16 wCoreJTExpSize;
+               [value(ndr_size_spoolss_PSDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
+               uint32 fxScrFreq;
+               uint32 fxScrAngle;
+               spoolss_DMPS_Dialect iDialect;
+               spoolss_DMPS_TTDLFmt iTTDLFmt;
+               boolean32 bReversePrint;
+               spoolss_DM_Layout iLayout;
+               spoolss_DMPS_PSLevel iPSLevel;
+               uint32 dwReserved2;
+               uint16 wOEMExtra;
+               [value(0x0010)] uint16 wVer;
+               uint32 dwX;
+               uint32 dwY;
+               uint32 dwWidthOffset;
+               uint32 dwHeightOffset;
+               spoolss_DMPS_FeedDirection wFeedDirection;
+               uint16 wCutSheet;
+               uint32 dwReserved3[4];
+               uint32 dwChecksum32;
+               uint32 dwOptions;
+               uint32 aOptions[128];
+               spoolss_DM_NupDirection dwNupDirection;
+               spoolss_DM_NupBorderFlags dwNupBorderFlags;
+               spoolss_DM_BookletFlags dwBookletFlags;
+               uint32 dwPadding;
+       } spoolss_PSDRVEXTRA;
+
+       /* Device Mode Extra Data: UniDriver */
+
+       /* NT 3.5, NT 4.0 */
+
+       typedef struct {
+               uint16 wReserved[56];
+       } spoolss_UNIDRVEXTRA3_4;
+
+       /* 2000, XP */
+
+       typedef [v1_enum] enum {
+               SPOOLSS_DM_UNI_QUALITY_BEST             = 0x00000000,
+               SPOOLSS_DM_UNI_QUALITY_MEDIUM           = 0x00000001,
+               SPOOLSS_DM_UNI_QUALITY_DRAFT            = 0x00000002
+       } spoolss_DMUNI_Quality;
+
+       typedef [bitmap32bit] bitmap {
+               SPOOLSS_DM_UNI_FLAGS_PRINT_TEXT_AS_GRAPHICS     = 0x00000002,
+               SPOOLSS_DM_UNI_FLAGS_AVOID_EMFSPOOL             = 0x00000010,
+               SPOOLSS_DM_UNI_FLAGS_CUSTOM_HALFTONING          = 0x00000080
+       } spoolss_DMUNI_Flags;
+
+       typedef struct {
+               [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature;
+               [value(0x0022)] uint16 wVer;
+               uint16 sPadding;
+               uint16 wSize;
+               uint16 wOEMExtra;
+               uint32 dwChecksum32;
+               spoolss_DMUNI_Flags dwFlags;
+               boolean32 bReversePrint;
+               spoolss_DM_Layout iLayout;
+               spoolss_DMUNI_Quality iQuality;
+               uint16 wReserved[6];
+               uint32 dwOptions;
+               uint32 aOptions[128];
+       } spoolss_UNIDRVEXTRA500;
+
+       /* Vista, 2008, 7 */
+
+       typedef [public,gensize] struct {
+               [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature;
+               [value(0x0022)] uint16 wVer;
+               uint16 wCoreJTExpSize;
+               [value(ndr_size_spoolss_UNIDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
+               uint16 wOEMExtra;
+               uint32 dwChecksum32;
+               spoolss_DMUNI_Flags dwFlags;
+               boolean32 bReversePrint;
+               spoolss_DM_Layout iLayout;
+               spoolss_DMUNI_Quality iQuality;
+               uint16 wReserved[6];
+               uint32 dwOptions;
+               uint32 aOptions[128];
+               spoolss_DM_NupDirection dwNupDirection;
+               spoolss_DM_NupBorderFlags dwNupBorderFlags;
+               spoolss_DM_BookletFlags dwBookletFlags;
+       } spoolss_UNIDRVEXTRA;
+
+       /* Device Mode Extra Data: JTEXP */
+
+       typedef struct {
+               uint32 dwSize;
+               [value(SPOOLSS_DM_SIGNATURE_JTEXP)] spoolss_DM_Signature dwSignature;
+               [value(0)] uint32 dwVersion;
+               [value(16)] uint16 wJTHdrSize;
+               uint16 wCoreMFOSize; /* must be sizeof the two following elements, must be dwSize - 16*/
+               nstring ModelName;
+               [flag(STR_UTF8|STR_NULLTERM|NDR_REMAINING)] string_array FeatureOptionPairs;
+       } spoolss_JTEXP;
+
+       /* Device Mode Extra Data: OEM_DMEXTRA */
+
+       typedef struct {
+               uint32 dwSize;
+               spoolss_DM_Signature dwSignature;
+               uint32 dwVersion;
+               [flag(NDR_REMAINING)] DATA_BLOB Data;
+       } spoolss_OEM_DMEXTRA;
+
+       typedef [nodiscriminant] union {
+               [case(0x0350)] spoolss_PSDRVEXTRA351    psdrvextra351;
+               [case(0x0400)] spoolss_PSDRVEXTRA400    psdrvextra400;
+               [case(0x0501)] spoolss_PSDRVEXTRA500    psdrvextra500;
+               [case(0x0600)] spoolss_PSDRVEXTRA       psdrvextra;
+               [default] [flag(NDR_REMAINING)] DATA_BLOB psblob;
+       } spoolss_DeviceModeExtraDataPostScript;
+
+       typedef [nodiscriminant] union {
+               [case(0x0301)] spoolss_UNIDRVEXTRA3_4   unidrvextra3_4;
+               [case(0x0500)] spoolss_UNIDRVEXTRA500   unidrvextra500;
+               [case(0x0600)] spoolss_UNIDRVEXTRA      unidrvextra;
+               [default] [flag(NDR_REMAINING)] DATA_BLOB uniblob;
+       } spoolss_DeviceModeExtraDataUniDriver;
+
        typedef [bitmap32bit] bitmap {
                DEVMODE_ORIENTATION             = 0x00000001,
                DEVMODE_PAPERSIZE               = 0x00000002,
@@ -374,7 +680,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        const int MAXDEVICENAME = 32;
 
        typedef [public,gensize] struct {
-               [charset(UTF16)] uint16 devicename[MAXDEVICENAME];
+               [charset(UTF16),to_null] uint16 devicename[MAXDEVICENAME];
                spoolss_DeviceModeSpecVersion specversion;
                uint16 driverversion;
                uint16 size;
@@ -393,7 +699,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint16 yresolution;
                spoolss_DeviceModeTTOption ttoption;
                spoolss_DeviceModeCollate collate;
-               [charset(UTF16)] uint16 formname[MAXDEVICENAME];
+               [charset(UTF16),to_null] uint16 formname[MAXDEVICENAME];
                uint16 logpixels; /* reserved */
                uint32 bitsperpel; /* reserved */
                uint32 pelswidth; /* reserved */
@@ -462,13 +768,13 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        } spoolss_PrinterAttributes;
 
        typedef [public,gensize] struct {
-               spoolss_PrinterAttributes flags;
+               spoolss_EnumPrinterFlags flags;
                [relative] nstring *description;
                [relative] nstring *name;
                [relative] nstring *comment;
        } spoolss_PrinterInfo1;
 
-       typedef [public,gensize] struct {
+       typedef [public,gensize,nopush] struct {
                [relative] nstring *servername;
                [relative] nstring *printername;
                [relative] nstring *sharename;
@@ -580,7 +886,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        /******************/
        /* Function: 0x01 */
        typedef struct {
-               [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->iconv_convenience, ndr->flags))] uint32 _ndr_size;
+               [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
                [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
        } spoolss_DevmodeContainer;
 
@@ -705,9 +1011,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *print_processor;
                [string,charset(UTF16)] uint16 *parameters;
                [string,charset(UTF16)] uint16 *driver_name;
-               uint32 _devmode_ptr; /* pointer to truncated devicemode */
+               uint32 *_devmode_ptr; /* pointer to truncated devicemode */
                [string,charset(UTF16)] uint16 *text_status;
-               uint32 _secdesc_ptr;
+               uint32 *_secdesc_ptr;
                spoolss_JobStatus status;
                [range(0,99)] uint32 priority;
                uint32 position;
@@ -731,9 +1037,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *print_processor;
                [string,charset(UTF16)] uint16 *parameters;
                [string,charset(UTF16)] uint16 *driver_name;
-               uint32 _devmode_ptr; /* pointer to truncated devicemode */
+               uint32 *_devmode_ptr; /* pointer to truncated devicemode */
                [string,charset(UTF16)] uint16 *text_status;
-               uint32 _secdesc_ptr;
+               uint32 *_secdesc_ptr;
                spoolss_JobStatus status;
                [range(0,99)] uint32 priority;
                uint32 position;
@@ -747,7 +1053,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 size_high;
        } spoolss_SetJobInfo4;
 
-       typedef [public] union {
+       typedef [ms_union,public] union {
                [case(1)] spoolss_SetJobInfo1 *info1;
                [case(2)] spoolss_SetJobInfo2 *info2;
                [case(3)] spoolss_JobInfo3    *info3;
@@ -857,19 +1163,19 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 global_counter;
                uint32 total_pages;
                uint32 version;
-               uint32 free_build;
+               spoolss_Build free_build;
                uint32 spooling;
                uint32 max_spooling;
                uint32 session_counter;
                uint32 num_error_out_of_paper;
                uint32 num_error_not_ready;
-               uint32 job_error;
+               spoolss_JobStatus job_error;
                uint32 number_of_processors;
                spoolss_ProcessorType processor_type;
                uint32 high_part_total_bytes;
                uint32 change_id;
                WERROR last_error;
-               uint32 status;
+               spoolss_PrinterStatus status;
                uint32 enumerate_network_printers;
                uint32 c_setprinter;
                spoolss_ProcessorArchitecture processor_architecture;
@@ -894,12 +1200,12 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *drivername;
                [string,charset(UTF16)] uint16 *comment;
                [string,charset(UTF16)] uint16 *location;
-               uint32 devmode_ptr;
+               uint32 *devmode_ptr;
                [string,charset(UTF16)] uint16 *sepfile;
                [string,charset(UTF16)] uint16 *printprocessor;
                [string,charset(UTF16)] uint16 *datatype;
                [string,charset(UTF16)] uint16 *parameters;
-               uint32 secdesc_ptr;
+               uint32 *secdesc_ptr;
                spoolss_PrinterAttributes attributes;
                [range(0,99)] uint32 priority;
                uint32 defaultpriority;
@@ -911,7 +1217,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        } spoolss_SetPrinterInfo2;
 
        typedef struct {
-               uint32 sec_desc_ptr;
+               uint32 *sec_desc_ptr;
        } spoolss_SetPrinterInfo3;
 
        typedef struct {
@@ -938,14 +1244,14 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        } spoolss_SetPrinterInfo7;
 
        typedef struct {
-               uint32 devmode_ptr;
+               uint32 *devmode_ptr;
        } spoolss_SetPrinterInfo8;
 
        typedef struct {
-               uint32 devmode_ptr;
+               uint32 *devmode_ptr;
        } spoolss_SetPrinterInfo9;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(0)] spoolss_SetPrinterInfo0 *info0;
                [case(1)] spoolss_SetPrinterInfo1 *info1;
                [case(2)] spoolss_SetPrinterInfo2 *info2;
@@ -964,7 +1270,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [switch_is(level)] spoolss_SetPrinterInfo info;
        } spoolss_SetPrinterInfoCtr;
 
-       WERROR spoolss_SetPrinter(
+       [public] WERROR spoolss_SetPrinter(
                [in,ref] policy_handle *handle,
                [in,ref] spoolss_SetPrinterInfoCtr *info_ctr,
                [in,ref] spoolss_DevmodeContainer *devmode_ctr,
@@ -987,7 +1293,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        /* Function: 0x09 */
 
        typedef [public] struct {
-               [value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
+               [value((ndr_size_spoolss_StringArray(r, ndr->flags)-4)/2)] uint32 _ndr_size;
                /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
        } spoolss_StringArray;
 
@@ -999,7 +1305,8 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                SPOOLSS_DRIVER_VERSION_9X       = 0,
                SPOOLSS_DRIVER_VERSION_NT35     = 1,
                SPOOLSS_DRIVER_VERSION_NT4      = 2,
-               SPOOLSS_DRIVER_VERSION_200X     = 3
+               SPOOLSS_DRIVER_VERSION_200X     = 3,
+               SPOOLSS_DRIVER_VERSION_2012     = 4
        } spoolss_DriverOSVersion;
 
        typedef struct {
@@ -1021,7 +1328,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *help_file;
                [string,charset(UTF16)] uint16 *monitor_name;
                [string,charset(UTF16)] uint16 *default_datatype;
-               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
+               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
                spoolss_StringArray *dependent_files;
        } spoolss_AddDriverInfo3;
 
@@ -1035,14 +1342,24 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *help_file;
                [string,charset(UTF16)] uint16 *monitor_name;
                [string,charset(UTF16)] uint16 *default_datatype;
-               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
+               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
                spoolss_StringArray *dependent_files;
-               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
+               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
                spoolss_StringArray *previous_names;
        } spoolss_AddDriverInfo4;
 
        typedef [bitmap32bit] bitmap {
-               PRINTER_DRIVER_PACKAGE_AWARE = 0x00000002
+               PRINTER_DRIVER_PACKAGE_AWARE            = 0x00000001,
+               PRINTER_DRIVER_XPS                      = 0x00000002,
+               PRINTER_DRIVER_SANDBOX_ENABLED          = 0x00000004,
+               PRINTER_DRIVER_CLASS                    = 0x00000008,
+               PRINTER_DRIVER_DERIVED                  = 0x00000010,
+               PRINTER_DRIVER_NOT_SHAREABLE            = 0x00000020,
+               PRINTER_DRIVER_CATEGORY_FAX             = 0x00000040,
+               PRINTER_DRIVER_CATEGORY_FILE            = 0x00000080,
+               PRINTER_DRIVER_CATEGORY_VIRTUAL         = 0x00000100,
+               PRINTER_DRIVER_CATEGORY_SERVICE         = 0x00000200,
+               PRINTER_DRIVER_SOFT_RESET_REQUIRED      = 0x00000400
        } spoolss_DriverAttributes;
 
        typedef struct {
@@ -1067,9 +1384,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *help_file;
                [string,charset(UTF16)] uint16 *monitor_name;
                [string,charset(UTF16)] uint16 *default_datatype;
-               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
+               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
                spoolss_StringArray *dependent_files;
-               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
+               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
                spoolss_StringArray *previous_names;
                NTTIME driver_date;
                hyper driver_version;
@@ -1089,9 +1406,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *help_file;
                [string,charset(UTF16)] uint16 *monitor_name;
                [string,charset(UTF16)] uint16 *default_datatype;
-               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
+               [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
                spoolss_StringArray *dependent_files;
-               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
+               [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
                spoolss_StringArray *previous_names;
                NTTIME driver_date;
                hyper driver_version;
@@ -1101,17 +1418,17 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *provider;
                [string,charset(UTF16)] uint16 *print_processor;
                [string,charset(UTF16)] uint16 *vendor_setup;
-               [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
+               [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
                spoolss_StringArray *color_profiles;
                [string,charset(UTF16)] uint16 *inf_path;
-               uint32 printer_driver_attributes;
-               [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
+               spoolss_DriverAttributes printer_driver_attributes;
+               [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
                spoolss_StringArray *core_driver_dependencies;
                NTTIME min_inbox_driver_ver_date;
                hyper min_inbox_driver_ver_version;
        } spoolss_AddDriverInfo8;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(1)] spoolss_AddDriverInfo1 *info1;
                [case(2)] spoolss_AddDriverInfo2 *info2;
                [case(3)] spoolss_AddDriverInfo3 *info3;
@@ -1232,7 +1549,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [relative] nstring *vendor_setup;
                [relative] nstring_array *color_profiles;
                [relative] nstring *inf_path;
-               uint32 printer_driver_attributes;
+               spoolss_DriverAttributes printer_driver_attributes;
                [relative] nstring_array *core_driver_dependencies;
                NTTIME min_inbox_driver_ver_date;
                hyper min_inbox_driver_ver_version;
@@ -1256,7 +1573,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                spoolss_DriverOSVersion version;
                [relative] nstring *driver_name;
                [relative] nstring *architecture;
-               [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info;
+               [relative,size_is(file_count),flag(NDR_ALIGN4)] spoolss_DriverFileInfo *file_info;
                uint32 file_count;
                [relative] nstring *monitor_name;
                [relative] nstring *default_datatype;
@@ -1429,17 +1746,21 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [string,charset(UTF16)] uint16 *datatype;
        } spoolss_DocumentInfo1;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(1)] spoolss_DocumentInfo1 *info1;
                [case(2)]; /* TODO */
                [case(3)]; /* TODO */
                [default];
        } spoolss_DocumentInfo;
 
+       typedef struct {
+               uint32 level;
+               [switch_is(level)] spoolss_DocumentInfo info;
+       } spoolss_DocumentInfoCtr;
+
        WERROR spoolss_StartDocPrinter(
                [in,ref] policy_handle *handle,
-               [in] uint32 level,
-               [in,switch_is(level)] spoolss_DocumentInfo info,
+               [in,ref] spoolss_DocumentInfoCtr *info_ctr,
                [out,ref] uint32 *job_id
        );
 
@@ -1512,6 +1833,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        const string SPL_ARCH_W32PPC            = "W32PPC";
        const string SPL_ARCH_IA64              = "IA64";
        const string SPL_ARCH_X64               = "x64";
+       const string SPL_ARCH_ARM               = "ARM";
 
        const string SPOOLSS_ARCHITECTURE_ALL                   = "All";
        const string SPOOLSS_ARCHITECTURE_ALL_CLUSTER           = "AllCluster";
@@ -1519,10 +1841,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        const string SPOOLSS_ARCHITECTURE_IA_64                 = "Windows IA64";
        const string SPOOLSS_ARCHITECTURE_x64                   = "Windows x64";
        const string SPOOLSS_ARCHITECTURE_4_0                   = "Windows 4.0";
+       const string SPOOLSS_ARCHITECTURE_ARM                   = "Windows ARM";
        const string SPOOLSS_DEFAULT_SERVER_PATH                = "C:\\WINDOWS\\system32\\spool";
 
        typedef [public,gensize] struct {
-               [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
+               [value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size;
                uint32 major;
                uint32 minor;
                uint32 build;
@@ -1531,7 +1854,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        } spoolss_OSVersion;
 
        typedef [public,gensize] struct {
-               [value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
+               [value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size;
                uint32 major;
                uint32 minor;
                uint32 build;
@@ -1621,46 +1944,23 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        const string SPOOL_REG_URL                      = "url";
        const string SPOOL_REG_VERSIONNUMBER            = "versionNumber";
 
-       [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
+       [public] WERROR spoolss_GetPrinterData(
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 value_name[],
-               [in]     uint32 offered,
                [out,ref] winreg_Type *type,
-               [out,ref] DATA_BLOB *data,
-               [out,ref] uint32 *needed
-       );
-       [noopnum,noprint,public] void __spoolss_GetPrinterData(
-               [in] winreg_Type type,
-               [out,ref,switch_is(type)] spoolss_PrinterData *data
-       );
-       [nopull,nopush,public] WERROR spoolss_GetPrinterData(
-               [in,ref] policy_handle *handle,
-               [in]     [string,charset(UTF16)] uint16 value_name[],
+               [out,ref,size_is(offered)] uint8 *data,
                [in]     uint32 offered,
-               [out,ref] winreg_Type *type,
-               [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data,
                [out,ref] uint32 *needed
        );
 
        /******************/
        /* Function: 0x1b */
-       [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
-               [in,ref] policy_handle *handle,
-               [in] [string,charset(UTF16)] uint16 value_name[],
-               [in] winreg_Type type,
-               [in] DATA_BLOB data,
-               [in] uint32 _offered
-       );
-       [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
-               [in] winreg_Type type,
-               [out,ref,switch_is(type)] spoolss_PrinterData *data
-       );
-       [nopush] WERROR spoolss_SetPrinterData(
+       WERROR spoolss_SetPrinterData(
                [in,ref] policy_handle *handle,
                [in] [string,charset(UTF16)] uint16 value_name[],
                [in] winreg_Type type,
-               [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
-               [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
+               [in,ref] [size_is(offered)] uint8 *data,
+               [in] uint32 offered
        );
 
        /******************/
@@ -1747,15 +2047,19 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 lang_id;
        } spoolss_AddFormInfo2;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(1)] spoolss_AddFormInfo1 *info1;
                [case(2)] spoolss_AddFormInfo2 *info2;
        } spoolss_AddFormInfo;
 
+       typedef struct {
+               uint32 level;
+               [switch_is(level)] spoolss_AddFormInfo info;
+       } spoolss_AddFormInfoCtr;
+
        WERROR spoolss_AddForm(
                [in,ref] policy_handle *handle,
-               [in] uint32 level,
-               [in,switch_is(level)] spoolss_AddFormInfo info
+               [in,ref] spoolss_AddFormInfoCtr *info_ctr
        );
 
        /******************/
@@ -1782,8 +2086,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        WERROR spoolss_SetForm(
                [in,ref] policy_handle *handle,
                [in] [string,charset(UTF16)] uint16 form_name[],
-               [in] uint32 level,
-               [in,switch_is(level)] spoolss_AddFormInfo info
+               [in,ref] spoolss_AddFormInfoCtr *info_ctr
        );
 
        /******************/
@@ -1952,6 +2255,42 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x25 */
+
+       typedef [public,gensize] struct {
+               [string,charset(UTF16)] uint16 *port_name;
+       } spoolss_SetPortInfo1;
+
+       typedef [public,gensize] struct {
+               [string,charset(UTF16)] uint16 *port_name;
+               [string,charset(UTF16)] uint16 *monitor_name;
+               [string,charset(UTF16)] uint16 *description;
+               spoolss_PortType port_type;
+               uint32 reserved;
+       } spoolss_SetPortInfo2;
+
+       typedef [public,gensize] struct {
+               spoolss_PortStatus status;
+               [string,charset(UTF16)] uint16 *status_string;
+               spoolss_PortSeverity severity;
+       } spoolss_SetPortInfo3;
+
+       typedef [public,gensize] struct {
+               [string,charset(UTF16)] uint16 *port_name;
+               DATA_BLOB monitor_data; /* relative ?? */
+       } spoolss_SetPortInfoFF;
+
+       typedef [ms_union,switch_type(uint32)] union {
+               [case(1)] spoolss_SetPortInfo1 *info1;
+               [case(2)] spoolss_SetPortInfo2 *info2;
+               [case(3)] spoolss_SetPortInfo3 *info3;
+               [case(0xff)] spoolss_SetPortInfoFF *infoFF;
+       } spoolss_SetPortInfo;
+
+       typedef struct {
+               uint32 level;
+               [switch_is(level)] spoolss_SetPrinterInfo info;
+       } spoolss_SetPortInfoContainer;
+
        WERROR spoolss_AddPort(
               [in,unique] [string,charset(UTF16)] uint16 *server_name,
               [in] uint32 unknown,
@@ -1965,7 +2304,10 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x27 */
-       [todo] WERROR spoolss_DeletePort(
+       WERROR spoolss_DeletePort(
+              [in,unique] [string,charset(UTF16)] uint16 *server_name,
+              [in] uint32 ptr,
+              [in,ref] [string,charset(UTF16)] uint16 *port_name
        );
 
        /******************/
@@ -1978,7 +2320,24 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x29 */
-       [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
+
+       typedef struct {
+               uint32 Checksum;
+               uint32 Index;
+       } UNIVERSAL_FONT_ID;
+
+       typedef [public] struct {
+               uint32 count;
+               UNIVERSAL_FONT_ID fonts[count];
+       } UNIVERSAL_FONT_ID_ctr;
+
+       WERROR spoolss_PlayGDIScriptOnPrinterIC(
+               [in,ref] policy_handle *gdi_handle,
+               [in,ref] [size_is(cIn)] uint8 *pIn,
+               [in] uint32 cIn,
+               [out,ref] [size_is(cOut)] uint8 *pOut,
+               [in] uint32 cOut,
+               [in] uint32 ul
        );
 
        /******************/
@@ -2077,7 +2436,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x35 */
-       WERROR spoolss_GetPrinterDriver2(
+       [public] WERROR spoolss_GetPrinterDriver2(
                [in,ref] policy_handle *handle,
                [in,unique] [string,charset(UTF16)] uint16 *architecture,
                [in]     uint32 level,
@@ -2189,7 +2548,17 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x3d */
-       [todo] WERROR spoolss_AddPortEx(
+
+       typedef struct {
+               uint32 monitor_data_size;
+               [size_is(monitor_data_size),unique] uint8 *monitor_data;
+       } spoolss_PortVarContainer;
+
+       WERROR spoolss_AddPortEx(
+               [in,unique] [string,charset(UTF16)] uint16 *servername,
+               [in,ref] spoolss_SetPortInfoContainer *port_ctr,
+               [in,ref] spoolss_PortVarContainer *port_var_ctr,
+               [in,unique] [string,charset(UTF16)] uint16 *monitor_name
        );
 
        /******************/
@@ -2323,7 +2692,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                NOTIFY_TABLE_SECURITYDESCRIPTOR = 0x0005
        } spoolss_NotifyTable;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union, switch_type(uint32)] union {
                [case(1)] uint32 integer[2];
                [case(2)] spoolss_NotifyString string;
                [case(3)] spoolss_DevmodeContainer devmode;
@@ -2346,7 +2715,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [size_is(count)] spoolss_Notify notifies[];
        } spoolss_NotifyInfo;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(0)] spoolss_NotifyInfo *info0;
        } spoolss_ReplyPrinterInfo;
 
@@ -2406,7 +2775,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                udlong reserved;
        } spoolss_UserLevel3;
 
-       typedef [switch_type(uint32)] union {
+       typedef [ms_union,switch_type(uint32)] union {
                [case(1)]  spoolss_UserLevel1 *level1;
                [case(2)]  spoolss_UserLevel2 *level2;
                [case(3)]  spoolss_UserLevel3 *level3;
@@ -2486,8 +2855,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [in,unique]           [string,charset(UTF16)] uint16 *datatype,
                [in]                  spoolss_DevmodeContainer devmode_ctr,
                [in]                  spoolss_AccessRights access_mask,
-               [in]                  uint32 level,
-               [in,switch_is(level)] spoolss_UserLevel userlevel,
+               [in]                  spoolss_UserLevelCtr userlevel_ctr,
                [out,ref]             policy_handle *handle
        );
 
@@ -2504,7 +2872,10 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x47 */
-       [todo] WERROR spoolss_47(
+       WERROR spoolss_SetPort(
+               [in,unique] [string,charset(UTF16)] uint16 *servername,
+               [in,unique] [string,charset(UTF16)] uint16 *port_name,
+               [in,ref] spoolss_SetPortInfoContainer *port_ctr
        );
 
        /******************/
@@ -2545,49 +2916,24 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x4d */
-       [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterDataEx(
+       WERROR spoolss_SetPrinterDataEx(
                [in,ref] policy_handle *handle,
                [in] [string,charset(UTF16)] uint16 key_name[],
                [in] [string,charset(UTF16)] uint16 value_name[],
                [in] winreg_Type type,
-               [in] DATA_BLOB data,
-               [in] uint32 _offered
-       );
-       [noopnum,nopull,noprint,public] void __spoolss_SetPrinterDataEx(
-               [in] winreg_Type type,
-               [out,ref,switch_is(type)] spoolss_PrinterData *data
-       );
-       [nopush] WERROR spoolss_SetPrinterDataEx(
-               [in,ref] policy_handle *handle,
-               [in] [string,charset(UTF16)] uint16 key_name[],
-               [in] [string,charset(UTF16)] uint16 value_name[],
-               [in] winreg_Type type,
-               [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
-               [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered
+               [in,ref] [size_is(offered)] uint8 *data,
+               [in] uint32 offered
        );
 
        /******************/
        /* Function: 0x4e */
-       [noopnum,noprint,public] WERROR _spoolss_GetPrinterDataEx(
+       WERROR spoolss_GetPrinterDataEx(
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 key_name[],
                [in]     [string,charset(UTF16)] uint16 value_name[],
-               [in]     uint32 offered,
                [out,ref] winreg_Type *type,
-               [out,ref] DATA_BLOB *data,
-               [out,ref] uint32 *needed
-       );
-       [noopnum,noprint,public] void __spoolss_GetPrinterDataEx(
-               [in] winreg_Type type,
-               [out,ref,switch_is(type)] spoolss_PrinterData *data
-       );
-       [nopull,nopush,public] WERROR spoolss_GetPrinterDataEx(
-               [in,ref] policy_handle *handle,
-               [in]     [string,charset(UTF16)] uint16 key_name[],
-               [in]     [string,charset(UTF16)] uint16 value_name[],
+               [out,ref,size_is(offered)] uint8 *data,
                [in]     uint32 offered,
-               [out,ref] winreg_Type *type,
-               [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data,
                [out,ref] uint32 *needed
        );
 
@@ -2598,8 +2944,8 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                [relative] nstring *value_name;
                [value(2*strlen_m_term(value_name))] uint32 value_name_len;
                winreg_Type type;
-               [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data;
-               [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length;
+               [relative,subcontext(0),subcontext_size(data_length),flag(NDR_REMAINING|ndr_spoolss_PrinterEnumValues_align(r->type))] DATA_BLOB *data;
+               [value(data ? data->length : 0)] uint32 data_length;
        } spoolss_PrinterEnumValues;
 
        [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
@@ -2678,17 +3024,23 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x55 */
-       [todo] WERROR spoolss_55(
+       WERROR spoolss_AddPerMachineConnection(
+               [in,unique] [string,charset(UTF16)] uint16 *server,
+               [in,ref] [string,charset(UTF16)] uint16 *printername,
+               [in,ref] [string,charset(UTF16)] uint16 *printserver,
+               [in,ref] [string,charset(UTF16)] uint16 *provider
        );
 
        /******************/
        /* Function: 0x56 */
-       [todo] WERROR spoolss_56(
+       WERROR spoolss_DeletePerMachineConnection(
+               [in,unique] [string,charset(UTF16)] uint16 *server,
+               [in,ref] [string,charset(UTF16)] uint16 *printername
        );
 
        /******************/
        /* Function: 0x57 */
-       [todo] WERROR spoolss_57(
+       [todo] WERROR spoolss_EnumPerMachineConnections(
        );
 
        /******************/
@@ -2699,11 +3051,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                PROTOCOL_LPR_TYPE       = 2
        } spoolss_PortProtocol;
 
-       typedef [public] struct {
+       typedef [public,gensize] struct {
                [charset(UTF16)] uint16 portname[64];
                [value(0x00000001)] uint32 version;
                spoolss_PortProtocol protocol;
-               [value(sizeof(r))] uint32 size;
+               [value(ndr_size_spoolss_PortData1(r, ndr->flags))] uint32 size;
                uint32 reserved;
                [charset(UTF16)] uint16 hostaddress[49];
                [charset(UTF16)] uint16 snmpcommunity[33];
@@ -2717,11 +3069,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
                uint32 snmp_dev_index;
        } spoolss_PortData1;
 
-       typedef [public] struct {
+       typedef [public,gensize] struct {
                [charset(UTF16)] uint16 portname[64];
                [value(0x00000002)] uint32 version;
                spoolss_PortProtocol protocol;
-               [value(sizeof(r))] uint32 size;
+               [value(ndr_size_spoolss_PortData2(r, ndr->flags))] uint32 size;
                uint32 reserved;
                [charset(UTF16)] uint16 hostaddress[128];
                [charset(UTF16)] uint16 snmpcommunity[33];
@@ -2806,7 +3158,76 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x61 */
-       [todo] WERROR spoolss_61(
+
+       const string BIDI_ACTION_ENUM_SCHEMA = "EnumSchema";
+       const string BIDI_ACTION_GET = "Get";
+       const string BIDI_ACTION_SET = "Set";
+       const string BIDI_ACTION_GET_ALL = "GetAll";
+
+       typedef enum {
+               BIDI_NULL       = 0x00000000,
+               BIDI_INT        = 0x00000001,
+               BIDI_FLOAT      = 0x00000002,
+               BIDI_BOOL       = 0x00000003,
+               BIDI_STRING     = 0x00000004,
+               BIDI_TEXT       = 0x00000005,
+               BIDI_ENUM       = 0x00000006,
+               BIDI_BLOB       = 0x00000007
+       } BIDI_TYPE;
+
+       typedef struct {
+               uint32 cbBuf;
+               [size_is(cbBuf), unique] uint8 *pszString;
+       } RPC_BINARY_CONTAINER;
+
+       typedef [ms_union,switch_type(uint32)] union {
+               [case(BIDI_NULL)]       uint32 bData;
+               [case(BIDI_BOOL)]       uint32 bData;
+               [case(BIDI_INT)]        uint32 iData;
+               [case(BIDI_STRING)]     [unique] [string,charset(UTF16)] uint16 *sData;
+               [case(BIDI_TEXT)]       [unique] [string,charset(UTF16)] uint16 *sData;
+               [case(BIDI_ENUM)]       [unique] [string,charset(UTF16)] uint16 *sData;
+               /*[case(BIDI_FLOAT)]    float fData;*/
+               [case(BIDI_BLOB)]       RPC_BINARY_CONTAINER biData;
+       } RPC_BIDI_DATA_u;
+
+       typedef struct {
+               uint32 dwBidiType;
+               [switch_is(dwBidiType)] RPC_BIDI_DATA_u u;
+       } RPC_BIDI_DATA;
+
+       typedef struct {
+               uint32 dwReqNumber;
+               [unique] [string,charset(UTF16)] uint16 *pSchema;
+               RPC_BIDI_DATA data;
+       } RPC_BIDI_REQUEST_DATA;
+
+       typedef [public] struct {
+               [value(1)] uint32 Version;
+               uint32 Flags;
+               uint32 Count;
+               [size_is(Count), unique] RPC_BIDI_REQUEST_DATA *aData[];
+       } RPC_BIDI_REQUEST_CONTAINER;
+
+       typedef struct {
+               uint32 dwResult;
+               uint32 dwReqNumber;
+               [unique] [string,charset(UTF16)] uint16 *pSchema;
+               RPC_BIDI_DATA data;
+       } RPC_BIDI_RESPONSE_DATA;
+
+       typedef [public] struct {
+               [value(1)] uint32 Version;
+               uint32 Flags;
+               uint32 Count;
+               [size_is(Count), unique] RPC_BIDI_RESPONSE_DATA *aData[];
+       } RPC_BIDI_RESPONSE_CONTAINER;
+
+       WERROR spoolss_RpcSendRecvBidiData(
+               [in] policy_handle hPrinter,
+               [in,unique] [string,charset(UTF16)] uint16 *pAction,
+               [in] RPC_BIDI_REQUEST_CONTAINER *pReqData,
+               [out] RPC_BIDI_RESPONSE_CONTAINER **ppRespData
        );
 
        /******************/
@@ -2888,4 +3309,24 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
        /* Function: 0x6d */
        [todo] WERROR spoolss_6d(
        );
+
+       /******************/
+       /* Function: 0x6e */
+       [todo] WERROR spoolss_RpcGetJobNamedPropertyValue(
+       );
+
+       /******************/
+       /* Function: 0x6f */
+       [todo] WERROR spoolss_RpcSetJobNamedProperty(
+       );
+
+       /******************/
+       /* Function: 0x70 */
+       [todo] WERROR spoolss_RpcDeleteJobNamedProperty(
+       );
+
+       /******************/
+       /* Function: 0x71 */
+       [todo] WERROR spoolss_RpcEnumJobNamedProperties(
+       );
 }