drsuapi.idl: drsuapi_DsGetNCChangesCompressionType is just an enum
[metze/samba/wip.git] / librpc / idl / drsuapi.idl
index af7e3ed48c9699929418e59e9522f41fa4136b2f..d81ecfca86ba68394ecc94b98c279f573991d3ea 100644 (file)
@@ -115,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;
@@ -130,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;
@@ -139,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
@@ -160,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
@@ -204,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;
 
@@ -546,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;
 
@@ -713,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;
@@ -806,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;
 
@@ -1107,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;
 
@@ -1204,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;
@@ -1220,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
                );