drsuapi.idl: drsuapi_DsGetNCChangesCompressionType is just an enum
[metze/samba/wip.git] / librpc / idl / drsuapi.idl
index 63af4ae5d6cc8c7fe95daa491bbafa6d63fe98dd..d81ecfca86ba68394ecc94b98c279f573991d3ea 100644 (file)
@@ -58,6 +58,13 @@ interface drsuapi
                DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP  = 0x80000000
        } drsuapi_DrsOptions;
 
+       /* see DRS_MSG_REPMOD_V1 */
+       typedef [public,bitmap32bit] bitmap {
+               DRSUAPI_DRS_UPDATE_FLAGS              = 0x00000001,
+               DRSUAPI_DRS_UPDATE_ADDRESS            = 0x00000002,
+               DRSUAPI_DRS_UPDATE_SCHEDULE           = 0x00000004
+        } drsuapi_DrsUpdate;
+
        /*****************/
         /* Function 0x00 */
         typedef [bitmap32bit] bitmap {
@@ -108,14 +115,14 @@ interface drsuapi
        } drsuapi_SupportedExtensionsExt;
 
        /* this is used by w2k */
-       typedef struct {
+       typedef [public] struct {
                drsuapi_SupportedExtensions supported_extensions;
                GUID site_guid;
                uint32 pid;
        } drsuapi_DsBindInfo24;
 
        /* this is used by w2k3 */
-       typedef struct {
+       typedef [public] struct {
                drsuapi_SupportedExtensions supported_extensions;
                GUID site_guid;
                uint32 pid;
@@ -123,7 +130,7 @@ interface drsuapi
        } drsuapi_DsBindInfo28;
 
        /* this is used by w2k8 */
-       typedef struct {
+       typedef [public] struct {
                drsuapi_SupportedExtensions supported_extensions;
                GUID site_guid;
                uint32 pid;
@@ -132,15 +139,21 @@ interface drsuapi
                GUID config_dn_guid;
        } drsuapi_DsBindInfo48;
 
-       typedef struct {
+       typedef [public] struct {
                [flag(NDR_REMAINING)] DATA_BLOB info;
        } drsuapi_DsBindInfoFallBack;
 
-       typedef [nodiscriminant] union {
-               [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24;
-               [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28;
-               [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48;
-               [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;
+       typedef [nopull, nopush, noprint] [nodiscriminant] union {
+               [case(24)][subcontext(0), subcontext_size(24)] drsuapi_DsBindInfo24 info24;
+               [case(28)][subcontext(0), subcontext_size(28)] drsuapi_DsBindInfo28 info28;
+               [case(48)][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfo48 info48;
+               /*
+                * The size for the defaut case is a bit arbitrary it in fact the value
+                * of the switch but we can't reference it.
+                * As we hand(un-)marshall this structure it has 0 impact and makes
+                * pidl happy for wireshark too
+                */
+               [default][subcontext(0), subcontext_size(48)] drsuapi_DsBindInfoFallBack Fallback;
        } drsuapi_DsBindInfo;
 
        /* the drsuapi_DsBindInfoCtr was this before
@@ -153,11 +166,44 @@ interface drsuapi
         * so we're doing it here
         */
 
+       /*
+        * MS-DRSR.pdf gives the following definition
+       typedef struct {
+               [range(1,10000)] DWORD cb;
+               [size_is(cb)] BYTE rgb[];
+       } DRS_EXTENSIONS;
+
+       But we use a subcontext which has a slighly different signification on how
+       data are laid out.
+       With the MS-DRSR definition we will have
+               size_is_cb cv rgb_array
+       with size_is_cb being a uint3264 and cv being a uint32
+
+       We used to have
        typedef struct {
                [range(1,10000)] uint32 length;
                [switch_is(length)] drsuapi_DsBindInfo info;
        } drsuapi_DsBindInfoCtr;
 
+       typedef [nodiscriminant] union {
+               [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24;
+               [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28;
+               [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48;
+               [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;
+       } drsuapi_DsBindInfo;
+
+       With this definition data is laid out this way:
+       length subcontext_size drsuapi_DsBindInfoxx
+       with length being a uint32 and subcontext_size being a uint3264
+
+       It has clearly an impact on the way things are aligned when using NDR64
+       */
+       typedef [flag(NDR_NOALIGN)] struct {
+               [range(1,10000)] uint3264 length;
+               [value(length)] uint32 __ndr_length;
+               [switch_is(length)] drsuapi_DsBindInfo info;
+       } drsuapi_DsBindInfoCtr;
+
        /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
         *
         * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
@@ -186,7 +232,7 @@ interface drsuapi
        /*****************/
        /* Function 0x02 */
        typedef [public,gensize] struct {
-               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags)-4)] uint32 __ndr_size;
+               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags)-4)] uint32 __ndr_size;
                [value(ndr_size_dom_sid28(&sid, ndr->flags))]  uint32 __ndr_size_sid;
                GUID guid;
                dom_sid28 sid;
@@ -197,7 +243,7 @@ interface drsuapi
        typedef struct {
                [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
                GUID source_dsa_guid;
-               astring *source_dsa_dns; /* Source DSA dns_name in <guid>._msdcs.<domain_dns> form */
+               [charset(DOS),string] char *source_dsa_dns; /* Source DSA dns_name in <guid>._msdcs.<domain_dns> form */
                drsuapi_DrsOptions options;
        } drsuapi_DsReplicaSyncRequest1;
 
@@ -382,81 +428,99 @@ interface drsuapi
        } drsuapi_DsObjectClassId;
 
        typedef [flag(NDR_PAHEX),v1_enum,public] enum {
-               DRSUAPI_ATTRIBUTE_objectClass                   = 0x00000000,
-               DRSUAPI_ATTRIBUTE_cn                            = 0x00000003,
-               DRSUAPI_ATTRIBUTE_description                   = 0x0000000d,
-               DRSUAPI_ATTRIBUTE_member                        = 0x0000001f,
-               DRSUAPI_ATTRIBUTE_instanceType                  = 0x00020001,
-               DRSUAPI_ATTRIBUTE_whenCreated                   = 0x00020002,
-               DRSUAPI_ATTRIBUTE_possSuperiors                 = 0x00020008,
-               DRSUAPI_ATTRIBUTE_hasMasterNCs                  = 0x0002000e,
-               DRSUAPI_ATTRIBUTE_subClassOf                    = 0x00020015,
-               DRSUAPI_ATTRIBUTE_governsID                     = 0x00020016,
-               DRSUAPI_ATTRIBUTE_mustContain                   = 0x00020018,
-               DRSUAPI_ATTRIBUTE_mayContain                    = 0x00020019,
-               DRSUAPI_ATTRIBUTE_rDNAttId                      = 0x0002001A,
-               DRSUAPI_ATTRIBUTE_attributeID                   = 0x0002001e,
-               DRSUAPI_ATTRIBUTE_attributeSyntax               = 0x00020020,
-               DRSUAPI_ATTRIBUTE_isSingleValued                = 0x00020021,
-               DRSUAPI_ATTRIBUTE_rangeLower                    = 0x00020022,
-               DRSUAPI_ATTRIBUTE_rangeUpper                    = 0x00020023,
-               DRSUAPI_ATTRIBUTE_dMDLocation                   = 0x00020024,
-               DRSUAPI_ATTRIBUTE_objectVersion                 = 0x0002004c,
-               DRSUAPI_ATTRIBUTE_invocationId                  = 0x00020073,
-               DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly        = 0x000200a9,
-               DRSUAPI_ATTRIBUTE_adminDisplayName              = 0x000200c2,
-               DRSUAPI_ATTRIBUTE_adminDescription              = 0x000200e2,
-               DRSUAPI_ATTRIBUTE_oMSyntax                      = 0x000200e7,
-               DRSUAPI_ATTRIBUTE_ntSecurityDescriptor          = 0x00020119,
-               DRSUAPI_ATTRIBUTE_searchFlags                   = 0x0002014e,
-               DRSUAPI_ATTRIBUTE_auxiliaryClass                = 0x0002015f,
-               DRSUAPI_ATTRIBUTE_lDAPDisplayName               = 0x000201cc,
-               DRSUAPI_ATTRIBUTE_name                          = 0x00090001,
-               DRSUAPI_ATTRIBUTE_userAccountControl            = 0x00090008,
-               DRSUAPI_ATTRIBUTE_currentValue                  = 0x0009001b,
-               DRSUAPI_ATTRIBUTE_homeDirectory                 = 0x0009002c,
-               DRSUAPI_ATTRIBUTE_homeDrive                     = 0x0009002d,
-               DRSUAPI_ATTRIBUTE_scriptPath                    = 0x0009003e,
-               DRSUAPI_ATTRIBUTE_profilePath                   = 0x0009008b,
-               DRSUAPI_ATTRIBUTE_objectSid                     = 0x00090092,
-               DRSUAPI_ATTRIBUTE_schemaIDGUID                  = 0x00090094,
-               DRSUAPI_ATTRIBUTE_dBCSPwd                       = 0x00090037,/* lmPwdHash */
-               DRSUAPI_ATTRIBUTE_logonHours                    = 0x00090040,
-               DRSUAPI_ATTRIBUTE_userWorkstations              = 0x00090056,
-               DRSUAPI_ATTRIBUTE_unicodePwd                    = 0x0009005a,/* ntPwdHash */
-               DRSUAPI_ATTRIBUTE_ntPwdHistory                  = 0x0009005e,
-               DRSUAPI_ATTRIBUTE_priorValue                    = 0x00090064,
-               DRSUAPI_ATTRIBUTE_supplementalCredentials       = 0x0009007d,
-               DRSUAPI_ATTRIBUTE_trustAuthIncoming             = 0x00090081,
-               DRSUAPI_ATTRIBUTE_trustAuthOutgoing             = 0x00090087,
-               DRSUAPI_ATTRIBUTE_lmPwdHistory                  = 0x000900a0,
-               DRSUAPI_ATTRIBUTE_systemPossSuperiors           = 0x000900c3,
-               DRSUAPI_ATTRIBUTE_systemMayContain              = 0x000900c4,
-               DRSUAPI_ATTRIBUTE_systemMustContain             = 0x000900c5,
-               DRSUAPI_ATTRIBUTE_systemAuxiliaryClass          = 0x000900c6,
-               DRSUAPI_ATTRIBUTE_sAMAccountName                = 0x000900dd,
-               DRSUAPI_ATTRIBUTE_sAMAccountType                = 0x0009012e,
-               DRSUAPI_ATTRIBUTE_options                       = 0x00090133,
-               DRSUAPI_ATTRIBUTE_fSMORoleOwner                 = 0x00090171,
-               DRSUAPI_ATTRIBUTE_systemFlags                   = 0x00090177,
-               DRSUAPI_ATTRIBUTE_serverReference               = 0x00090203,
-               DRSUAPI_ATTRIBUTE_serverReferenceBL             = 0x00090204,
-               DRSUAPI_ATTRIBUTE_initialAuthIncoming           = 0x0009021b,
-               DRSUAPI_ATTRIBUTE_initialAuthOutgoing           = 0x0009021c,
-               DRSUAPI_ATTRIBUTE_wellKnownObjects              = 0x0009026a,
-               DRSUAPI_ATTRIBUTE_dNSHostName                   = 0x0009026b,
-               DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet = 0x0009027f,
-               DRSUAPI_ATTRIBUTE_userPrincipalName             = 0x00090290,
-               DRSUAPI_ATTRIBUTE_groupType                     = 0x000902ee,
-               DRSUAPI_ATTRIBUTE_servicePrincipalName          = 0x00090303,
-               DRSUAPI_ATTRIBUTE_objectCategory                = 0x0009030e,
-               DRSUAPI_ATTRIBUTE_gPLink                        = 0x0009037b,
-               DRSUAPI_ATTRIBUTE_transportAddressAttribute     = 0x0009037f,
-               DRSUAPI_ATTRIBUTE_msDS_Behavior_Version         = 0x000905b3,
-               DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber         = 0x000906f6,
-               DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs             = 0x0009071c,
-               DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs             = 0x0009072c,           
-               DRSUAPI_ATTRIBUTE_NONE                          = 0xFFFFFFFF
+               DRSUAPI_ATTID_objectClass                       = 0x00000000,
+               DRSUAPI_ATTID_cn                                = 0x00000003,
+               DRSUAPI_ATTID_ou                                = 0x0000000b,
+               DRSUAPI_ATTID_description                       = 0x0000000d,
+               DRSUAPI_ATTID_member                            = 0x0000001f,
+               DRSUAPI_ATTID_instanceType                      = 0x00020001,
+               DRSUAPI_ATTID_whenCreated                       = 0x00020002,
+               DRSUAPI_ATTID_possSuperiors                     = 0x00020008,
+               DRSUAPI_ATTID_displayName                       = 0x0002000d,
+               DRSUAPI_ATTID_hasMasterNCs                      = 0x0002000e,
+               DRSUAPI_ATTID_nCName                            = 0x00020010,
+               DRSUAPI_ATTID_subClassOf                        = 0x00020015,
+               DRSUAPI_ATTID_governsID                         = 0x00020016,
+               DRSUAPI_ATTID_mustContain                       = 0x00020018,
+               DRSUAPI_ATTID_mayContain                        = 0x00020019,
+               DRSUAPI_ATTID_rDNAttId                          = 0x0002001A,
+               DRSUAPI_ATTID_attributeID                       = 0x0002001e,
+               DRSUAPI_ATTID_attributeSyntax                   = 0x00020020,
+               DRSUAPI_ATTID_isSingleValued                    = 0x00020021,
+               DRSUAPI_ATTID_rangeLower                        = 0x00020022,
+               DRSUAPI_ATTID_rangeUpper                        = 0x00020023,
+               DRSUAPI_ATTID_dMDLocation                       = 0x00020024,
+               DRSUAPI_ATTID_isDeleted                         = 0x00020030,
+               DRSUAPI_ATTID_objectVersion                     = 0x0002004c,
+               DRSUAPI_ATTID_invocationId                      = 0x00020073,
+               DRSUAPI_ATTID_showInAdvancedViewOnly            = 0x000200a9,
+               DRSUAPI_ATTID_adminDisplayName                  = 0x000200c2,
+               DRSUAPI_ATTID_adminDescription                  = 0x000200e2,
+               DRSUAPI_ATTID_oMSyntax                          = 0x000200e7,
+               DRSUAPI_ATTID_ntSecurityDescriptor              = 0x00020119,
+               DRSUAPI_ATTID_searchFlags                       = 0x0002014e,
+               DRSUAPI_ATTID_auxiliaryClass                    = 0x0002015f,
+               DRSUAPI_ATTID_lDAPDisplayName                   = 0x000201cc,
+               DRSUAPI_ATTID_name                              = 0x00090001,
+               DRSUAPI_ATTID_userAccountControl                = 0x00090008,
+               DRSUAPI_ATTID_badPwdCount                       = 0x0009000c,
+               DRSUAPI_ATTID_codePage                          = 0x00090010,
+               DRSUAPI_ATTID_countryCode                       = 0x00090019,
+               DRSUAPI_ATTID_currentValue                      = 0x0009001b,
+               DRSUAPI_ATTID_homeDirectory                     = 0x0009002c,
+               DRSUAPI_ATTID_homeDrive                         = 0x0009002d,
+               DRSUAPI_ATTID_lastLogoff                        = 0x00090033,
+               DRSUAPI_ATTID_lastLogon                         = 0x00090034,
+               DRSUAPI_ATTID_dBCSPwd                           = 0x00090037,/* lmPwdHash */
+               DRSUAPI_ATTID_scriptPath                        = 0x0009003e,
+               DRSUAPI_ATTID_logonHours                        = 0x00090040,
+               DRSUAPI_ATTID_userWorkstations                  = 0x00090056,
+               DRSUAPI_ATTID_unicodePwd                        = 0x0009005a,/* ntPwdHash */
+               DRSUAPI_ATTID_ntPwdHistory                      = 0x0009005e,
+               DRSUAPI_ATTID_pwdLastSet                        = 0x00090060,
+               DRSUAPI_ATTID_primaryGroupID                    = 0x00090062,
+               DRSUAPI_ATTID_priorValue                        = 0x00090064,
+               DRSUAPI_ATTID_supplementalCredentials           = 0x0009007d,
+               DRSUAPI_ATTID_trustAuthIncoming                 = 0x00090081,
+               DRSUAPI_ATTID_trustAuthOutgoing                 = 0x00090087,
+               DRSUAPI_ATTID_userParameters                    = 0x0009008a,
+               DRSUAPI_ATTID_profilePath                       = 0x0009008b,
+               DRSUAPI_ATTID_objectSid                         = 0x00090092,
+               DRSUAPI_ATTID_schemaIDGUID                      = 0x00090094,
+               DRSUAPI_ATTID_comment                           = 0x0009009C,/* User-Comment */
+               DRSUAPI_ATTID_accountExpires                    = 0x0009009f,
+               DRSUAPI_ATTID_lmPwdHistory                      = 0x000900a0,
+               DRSUAPI_ATTID_logonCount                        = 0x000900a9,
+               DRSUAPI_ATTID_systemPossSuperiors               = 0x000900c3,
+               DRSUAPI_ATTID_systemMayContain                  = 0x000900c4,
+               DRSUAPI_ATTID_systemMustContain                 = 0x000900c5,
+               DRSUAPI_ATTID_systemAuxiliaryClass              = 0x000900c6,
+               DRSUAPI_ATTID_sAMAccountName                    = 0x000900dd,
+               DRSUAPI_ATTID_sAMAccountType                    = 0x0009012e,
+               DRSUAPI_ATTID_options                           = 0x00090133,
+               DRSUAPI_ATTID_fSMORoleOwner                     = 0x00090171,
+               DRSUAPI_ATTID_systemFlags                       = 0x00090177,
+               DRSUAPI_ATTID_serverReference                   = 0x00090203,
+               DRSUAPI_ATTID_serverReferenceBL                 = 0x00090204,
+               DRSUAPI_ATTID_initialAuthIncoming               = 0x0009021b,
+               DRSUAPI_ATTID_initialAuthOutgoing               = 0x0009021c,
+               DRSUAPI_ATTID_wellKnownObjects                  = 0x0009026a,
+               DRSUAPI_ATTID_dNSHostName                       = 0x0009026b,
+               DRSUAPI_ATTID_isMemberOfPartialAttributeSet     = 0x0009027f,
+               DRSUAPI_ATTID_userPrincipalName                 = 0x00090290,
+               DRSUAPI_ATTID_groupType                         = 0x000902ee,
+               DRSUAPI_ATTID_servicePrincipalName              = 0x00090303,
+               DRSUAPI_ATTID_lastKnownParent                   = 0x0009030d,
+               DRSUAPI_ATTID_objectCategory                    = 0x0009030e,
+               DRSUAPI_ATTID_gPLink                            = 0x0009037b,
+               DRSUAPI_ATTID_transportAddressAttribute         = 0x0009037f,
+               DRSUAPI_ATTID_msDS_Behavior_Version             = 0x000905b3,
+               DRSUAPI_ATTID_msDS_KeyVersionNumber             = 0x000906f6,
+               DRSUAPI_ATTID_msDS_HasDomainNCs                 = 0x0009071c,
+               DRSUAPI_ATTID_msDS_hasMasterNCs                 = 0x0009072c,
+               DRSUAPI_ATTID_isRecycled                        = 0x0009080a,
+
+               DRSUAPI_ATTID_INVALID                           = 0xFFFFFFFF
        } drsuapi_DsAttributeId;
 
        typedef struct {
@@ -521,7 +585,7 @@ interface drsuapi
 
        /* Generic DATA_BLOB values */
        typedef struct {
-               [range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
+               [range(0,26214400),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
                DATA_BLOB *blob;
        } drsuapi_DsAttributeValue;
 
@@ -532,7 +596,7 @@ interface drsuapi
 
        /* DN String values */
        typedef [public,gensize] struct {
-               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
+               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))] uint32 __ndr_size;
                [value(ndr_size_dom_sid28(&sid,ndr->flags))]  uint32 __ndr_size_sid;
                GUID guid;
                dom_sid28 sid;
@@ -541,7 +605,7 @@ interface drsuapi
        } drsuapi_DsReplicaObjectIdentifier3;
 
        typedef [public] struct {
-               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
+               [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->flags))] uint32 __ndr_size;
                [value(ndr_size_dom_sid28(&sid,ndr->flags))]  uint32 __ndr_size_sid;
                GUID guid;
                dom_sid28 sid;
@@ -551,7 +615,7 @@ interface drsuapi
                [flag(NDR_REMAINING)] DATA_BLOB binary;
        } drsuapi_DsReplicaObjectIdentifier3Binary;
 
-       typedef [public] struct {
+       typedef [public,noprint] struct {
                drsuapi_DsAttributeId attid;
                drsuapi_DsAttributeValueCtr value_ctr;
        } drsuapi_DsReplicaAttribute;
@@ -604,7 +668,7 @@ interface drsuapi
                drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */
                uint32 object_count;
                /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
-               [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
+               [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] uint32 __ndr_size;
                drsuapi_DsReplicaObjectListItemEx *first_object;
                boolean32 more_data;
        } drsuapi_DsGetNCChangesCtr1;
@@ -638,7 +702,7 @@ interface drsuapi
                drsuapi_DsExtendedError extended_ret;
                uint32 object_count;
                /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
-               [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
+               [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] uint32 __ndr_size;
                drsuapi_DsReplicaObjectListItemEx *first_object;
                boolean32 more_data;
                uint32 nc_object_count; /* estimated amount of objects in the whole NC */
@@ -688,7 +752,7 @@ interface drsuapi
                 drsuapi_DsGetNCChangesCtr6TS *ts;
        } drsuapi_DsGetNCChangesXPRESSCtr6;
 
-       typedef [enum16bit] enum {
+       typedef enum {
                DRSUAPI_COMPRESSION_TYPE_MSZIP  = 2,
                DRSUAPI_COMPRESSION_TYPE_XPRESS = 3
        } drsuapi_DsGetNCChangesCompressionType;
@@ -781,7 +845,7 @@ interface drsuapi
         /* Function 0x06 */
        typedef struct {
                [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
-               [charset(UTF16),string] uint16 *source_dsa_address;
+               [charset(UTF8), string] uint8 *source_dsa_address;
                drsuapi_DrsOptions options;
        } drsuapi_DsReplicaDelRequest1;
 
@@ -803,7 +867,7 @@ interface drsuapi
                GUID source_dra;
                [charset(UTF16),string] uint16 *source_dra_address;
                uint8 schedule[84];
-               uint32 replica_flags;
+               drsuapi_DrsOptions replica_flags;
                uint32 modify_fields;
                drsuapi_DrsOptions options;
        } drsuapi_DsReplicaModRequest1;
@@ -941,17 +1005,34 @@ interface drsuapi
        } drsuapi_DsNameFlags;
 
        typedef [v1_enum] enum {
-               DRSUAPI_DS_NAME_FORMAT_UNKNOWN                  = 0,
-               DRSUAPI_DS_NAME_FORMAT_FQDN_1779                = 1,
-               DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT              = 2,
-               DRSUAPI_DS_NAME_FORMAT_DISPLAY                  = 3,
-               DRSUAPI_DS_NAME_FORMAT_GUID                     = 6,
-               DRSUAPI_DS_NAME_FORMAT_CANONICAL                = 7,
-               DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL           = 8,
-               DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX             = 9,
-               DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL        = 10,
-               DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY       = 11,
-               DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN               = 12
+               DRSUAPI_DS_NAME_FORMAT_UNKNOWN                  = 0x00000000,
+               DRSUAPI_DS_NAME_FORMAT_FQDN_1779                = 0x00000001,
+               DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT              = 0x00000002,
+               DRSUAPI_DS_NAME_FORMAT_DISPLAY                  = 0x00000003,
+               DRSUAPI_DS_NAME_FORMAT_GUID                     = 0x00000006,
+               DRSUAPI_DS_NAME_FORMAT_CANONICAL                = 0x00000007,
+               DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL           = 0x00000008,
+               DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX             = 0x00000009,
+               DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL        = 0x0000000A,
+               DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY       = 0x0000000B,
+               DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN               = 0x0000000C,
+               DRSUAPI_DS_NAME_FORMAT_UPN_AND_ALTSECID         = 0xFFFFFFEF,
+               DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN_EX = 0xFFFFFFF0,
+               DRSUAPI_DS_NAME_FORMAT_LIST_GLOBAL_CATALOG_SERVERS = 0xFFFFFFF1,
+               DRSUAPI_DS_NAME_FORMAT_UPN_FOR_LOGON            = 0xFFFFFFF2,
+               DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_WITH_DCS_IN_SITE = 0xFFFFFFF3,
+               DRSUAPI_DS_NAME_FORMAT_STRING_SID_NAME          = 0xFFFFFFF4,
+               DRSUAPI_DS_NAME_FORMAT_ALT_SECURITY_IDENTITIES_NAME = 0xFFFFFFF5,
+               DRSUAPI_DS_NAME_FORMAT_LIST_NCS                 = 0xFFFFFFF6,
+               DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS             = 0xFFFFFFF7,
+               DRSUAPI_DS_NAME_FORMAT_MAP_SCHEMA_GUID          = 0xFFFFFFF8,
+               DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN = 0xFFFFFFF9,
+               DRSUAPI_DS_NAME_FORMAT_LIST_ROLES               = 0xFFFFFFFA,
+               DRSUAPI_DS_NAME_FORMAT_LIST_INFO_FOR_SERVER     = 0xFFFFFFFB,
+               DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_FOR_DOMAIN_IN_SITE = 0xFFFFFFFC,
+               DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS_IN_SITE     = 0xFFFFFFFD,
+               DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_IN_SITE     = 0xFFFFFFFE,
+               DRSUAPI_DS_NAME_FORMAT_LIST_SITES               = 0xFFFFFFFF
        } drsuapi_DsNameFormat;
 
        typedef struct {
@@ -1065,12 +1146,19 @@ interface drsuapi
 
        /*****************/
         /* Function 0x10 */
+       typedef [v1_enum] enum {
+               DRSUAPI_DC_INFO_CTR_1  = 1,
+               DRSUAPI_DC_INFO_CTR_2  = 2,
+               DRSUAPI_DC_INFO_CTR_3  = 3,
+               DRSUAPI_DC_CONNECTION_CTR_01 = 0xFFFFFFFF
+       } drsuapi_DsGetDCInfoCtrLevels;
+
        typedef struct {
                [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */
-               int32 level; /* specifies the switch level for the request */
+               drsuapi_DsGetDCInfoCtrLevels level; /* specifies the switch level for the request */
        } drsuapi_DsGetDCInfoRequest1;
 
-       typedef [switch_type(int32)] union {
+       typedef [switch_type(uint32)] union {
                [case(1)] drsuapi_DsGetDCInfoRequest1 req1;
        } drsuapi_DsGetDCInfoRequest;
 
@@ -1162,14 +1250,7 @@ interface drsuapi
                [size_is(count)] drsuapi_DsGetDCConnection01 *array;
        } drsuapi_DsGetDCConnectionCtr01;
 
-       typedef [v1_enum] enum {
-               DRSUAPI_DC_INFO_CTR_1  = 1,
-               DRSUAPI_DC_INFO_CTR_2  = 2,
-               DRSUAPI_DC_INFO_CTR_3  = 3,
-               DRSUAPI_DC_CONNECTION_CTR_01 = -1
-       } drsuapi_DsGetDCInfoCtrLevels;
-
-        typedef [switch_type(int32)] union {
+        typedef [switch_type(drsuapi_DsGetDCInfoCtrLevels)] union {
                [case(DRSUAPI_DC_INFO_CTR_1)]  drsuapi_DsGetDCInfoCtr1  ctr1;
                [case(DRSUAPI_DC_INFO_CTR_2)]  drsuapi_DsGetDCInfoCtr2  ctr2;
                [case(DRSUAPI_DC_INFO_CTR_3)]  drsuapi_DsGetDCInfoCtr3  ctr3;
@@ -1178,9 +1259,9 @@ interface drsuapi
 
        WERROR drsuapi_DsGetDomainControllerInfo(
                [in] policy_handle *bind_handle,
-               [in] int32 level,
+               [in] uint32 level,
                [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req,
-               [out,ref] int32 *level_out,
+               [out,ref] drsuapi_DsGetDCInfoCtrLevels *level_out,
                [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr
                );
 
@@ -1218,19 +1299,50 @@ interface drsuapi
        } drsuapi_DsAddEntry_DirErr;
 
        /*
-        * please note the the current idl
-        * for DsAddEntry does only parse
-        * what I saw between 2 w2k3 boxes
-        * in my dssync experiments I got some other replies
-        * so all I want to say is that this is very incomplete yet...
-        * --metze
+        * Ref: DRS_MSG_ADDENTRYREQ_V2, [MS-DRSR]: 4.1.1.1.3
         */
        typedef struct {
                drsuapi_DsReplicaObjectListItem first_object;
        } drsuapi_DsAddEntryRequest2;
 
+       /* Buffer type is actually more
+        * like a semi Flags
+        * Ref: DRS_SecBuffer, [MS-DRSR]: 5.41 */
+       typedef [v1_enum,noprint] enum {
+               DRSUAPI_SECBUFFER_EMPTY          = 0x00000000,
+               DRSUAPI_SECBUFFER_DATA           = 0x00000001,
+               DRSUAPI_SECBUFFER_TOKEN          = 0x00000002,
+               DRSUAPI_SECBUFFER_PKG_PARAMS     = 0x00000003,
+               DRSUAPI_SECBUFFER_MISSING        = 0x00000004,
+               DRSUAPI_SECBUFFER_EXTRA          = 0x00000005,
+               DRSUAPI_SECBUFFER_STREAM_TRAILER = 0x00000006,
+               DRSUAPI_SECBUFFER_STREAM_HEADER  = 0x00000007,
+               DRSUAPI_SECBUFFER_READONLY       = 0x80000000
+       } drsuapi_SecBufferType;
+
+       typedef struct {
+               [range(0,10000)] uint32 buf_size;
+               drsuapi_SecBufferType buf_type;
+               [size_is(buf_size)] uint8 *buffer;
+       } drsuapi_SecBuffer;
+
+       typedef struct {
+               [value(0)] uint32 version;
+               [range(0,10000)] uint32 buff_count;
+               [size_is(buff_count)] drsuapi_SecBuffer *buffers;
+       } drsuapi_SecBufferDesc;
+
+       /*
+        * Ref: DRS_MSG_ADDENTRYREQ_V3, [MS-DRSR]: 4.1.1.1.4
+        */
+       typedef struct {
+               drsuapi_DsReplicaObjectListItem first_object;
+               drsuapi_SecBufferDesc *client_creds;
+       } drsuapi_DsAddEntryRequest3;
+
        typedef [switch_type(uint32)] union {
                [case(2)] drsuapi_DsAddEntryRequest2 req2;
+               [case(3)] drsuapi_DsAddEntryRequest3 req3;
        } drsuapi_DsAddEntryRequest;
 
        /* Generic extended error info
@@ -1243,11 +1355,6 @@ interface drsuapi
                uint16  problem;        /* 0 or PROBLEM error code */
        } drsuapi_DsAddEntryErrorInfoX;
 
-       typedef struct {
-               [range(0,10485760)] uint32 size;
-               [size_is(size)] uint8 *data;
-       } drsuapi_DsAddEntryExtraErrorBuffer;
-
        /* Attribute errors
         * Ref: ATRERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.11 */
        typedef struct {
@@ -1333,10 +1440,10 @@ interface drsuapi
                [case(1)] drsuapi_DsAddEntryErrorInfo_Attr_V1   attr_err;
                [case(2)] drsuapi_DsAddEntryErrorInfo_Name_V1   name_err;
                [case(3)] drsuapi_DsAddEntryErrorInfo_Referr_V1 referral_err;
-               [case(4)] drsuapi_DsAddEntryErrorInfoX errorX;
-               [case(5)] drsuapi_DsAddEntryErrorInfoX errorX;
-               [case(6)] drsuapi_DsAddEntryErrorInfoX errorX;
-               [case(7)] drsuapi_DsAddEntryErrorInfoX errorX;
+               [case(4)] drsuapi_DsAddEntryErrorInfoX          security_err;
+               [case(5)] drsuapi_DsAddEntryErrorInfoX          service_err;
+               [case(6)] drsuapi_DsAddEntryErrorInfoX          update_err;
+               [case(7)] drsuapi_DsAddEntryErrorInfoX          system_err;
        } drsuapi_DsAddEntryErrorInfo;
 
        typedef struct {