| 1 | #include "idl_types.h" | 
|---|
| 2 |  | 
|---|
| 3 | import "security.idl", "misc.idl", "lsa.idl", "samr.idl"; | 
|---|
| 4 |  | 
|---|
| 5 | [ | 
|---|
| 6 | uuid("e3514235-4b06-11d1-ab04-00c04fc2dcd2"), | 
|---|
| 7 | version(4.0), | 
|---|
| 8 | endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]", "ncacn_ip_tcp:", "ncalrpc:"), | 
|---|
| 9 | authservice("ldap"), | 
|---|
| 10 | helpstring("Active Directory Replication"), | 
|---|
| 11 | helper("../librpc/ndr/ndr_drsuapi.h"), | 
|---|
| 12 | pointer_default(unique) | 
|---|
| 13 | ] | 
|---|
| 14 | interface drsuapi | 
|---|
| 15 | { | 
|---|
| 16 | typedef bitmap samr_GroupAttrs samr_GroupAttrs; | 
|---|
| 17 |  | 
|---|
| 18 | /* see MS-DRSR section 5.39 */ | 
|---|
| 19 | typedef [public,bitmap32bit] bitmap { | 
|---|
| 20 | DRSUAPI_DRS_ASYNC_OP                  = 0x00000001, | 
|---|
| 21 | DRSUAPI_DRS_GETCHG_CHECK              = 0x00000002, | 
|---|
| 22 | DRSUAPI_DRS_UPDATE_NOTIFICATION       = 0x00000002, | 
|---|
| 23 | DRSUAPI_DRS_ADD_REF                   = 0x00000004, | 
|---|
| 24 | DRSUAPI_DRS_SYNC_ALL                  = 0x00000008, | 
|---|
| 25 | DRSUAPI_DRS_DEL_REF                   = 0x00000008, | 
|---|
| 26 | DRSUAPI_DRS_WRIT_REP                  = 0x00000010, | 
|---|
| 27 | DRSUAPI_DRS_INIT_SYNC                 = 0x00000020, | 
|---|
| 28 | DRSUAPI_DRS_PER_SYNC                  = 0x00000040, | 
|---|
| 29 | DRSUAPI_DRS_MAIL_REP                  = 0x00000080, | 
|---|
| 30 | DRSUAPI_DRS_ASYNC_REP                 = 0x00000100, | 
|---|
| 31 | DRSUAPI_DRS_IGNORE_ERROR              = 0x00000100, | 
|---|
| 32 | DRSUAPI_DRS_TWOWAY_SYNC               = 0x00000200, | 
|---|
| 33 | DRSUAPI_DRS_CRITICAL_ONLY             = 0x00000400, | 
|---|
| 34 | DRSUAPI_DRS_GET_ANC                   = 0x00000800, | 
|---|
| 35 | DRSUAPI_DRS_GET_NC_SIZE               = 0x00001000, | 
|---|
| 36 | DRSUAPI_DRS_LOCAL_ONLY                = 0x00001000, | 
|---|
| 37 | DRSUAPI_DRS_NONGC_RO_REP              = 0x00002000, | 
|---|
| 38 | DRSUAPI_DRS_SYNC_BYNAME               = 0x00004000, | 
|---|
| 39 | DRSUAPI_DRS_REF_OK                    = 0x00004000, | 
|---|
| 40 | DRSUAPI_DRS_FULL_SYNC_NOW             = 0x00008000, | 
|---|
| 41 | DRSUAPI_DRS_NO_SOURCE                 = 0x00008000, | 
|---|
| 42 | DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS     = 0x00010000, | 
|---|
| 43 | DRSUAPI_DRS_FULL_SYNC_PACKET          = 0x00020000, | 
|---|
| 44 | DRSUAPI_DRS_SYNC_REQUEUE              = 0x00040000, | 
|---|
| 45 | DRSUAPI_DRS_SYNC_URGENT               = 0x00080000, | 
|---|
| 46 | DRSUAPI_DRS_REF_GCSPN                 = 0x00100000, | 
|---|
| 47 | DRSUAPI_DRS_NO_DISCARD                = 0x00100000, | 
|---|
| 48 | DRSUAPI_DRS_NEVER_SYNCED              = 0x00200000, | 
|---|
| 49 | DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING = 0x00400000, | 
|---|
| 50 | DRSUAPI_DRS_INIT_SYNC_NOW             = 0x00800000, | 
|---|
| 51 | DRSUAPI_DRS_PREEMPTED                 = 0x01000000, | 
|---|
| 52 | DRSUAPI_DRS_SYNC_FORCED               = 0x02000000, | 
|---|
| 53 | DRSUAPI_DRS_DISABLE_AUTO_SYNC         = 0x04000000, | 
|---|
| 54 | DRSUAPI_DRS_DISABLE_PERIODIC_SYNC     = 0x08000000, | 
|---|
| 55 | DRSUAPI_DRS_USE_COMPRESSION           = 0x10000000, | 
|---|
| 56 | DRSUAPI_DRS_NEVER_NOTIFY              = 0x20000000, | 
|---|
| 57 | DRSUAPI_DRS_SYNC_PAS                  = 0x40000000, | 
|---|
| 58 | DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP  = 0x80000000 | 
|---|
| 59 | } drsuapi_DrsOptions; | 
|---|
| 60 |  | 
|---|
| 61 | /*****************/ | 
|---|
| 62 | /* Function 0x00 */ | 
|---|
| 63 | typedef [bitmap32bit] bitmap { | 
|---|
| 64 | DRSUAPI_SUPPORTED_EXTENSION_BASE                        = 0x00000001, | 
|---|
| 65 | DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION           = 0x00000002, | 
|---|
| 66 | DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI                   = 0x00000004, | 
|---|
| 67 | DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2                  = 0x00000008, | 
|---|
| 68 | DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS             = 0x00000010, | 
|---|
| 69 | DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1                   = 0x00000020, | 
|---|
| 70 | DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION    = 0x00000040, | 
|---|
| 71 | DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY                    = 0x00000080, | 
|---|
| 72 | DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE                 = 0x00000100, | 
|---|
| 73 | DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2                 = 0x00000200, | 
|---|
| 74 | DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION    = 0x00000400, | 
|---|
| 75 | DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2                   = 0x00000800, | 
|---|
| 76 | DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD= 0x00001000, | 
|---|
| 77 | DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND                 = 0x00002000, | 
|---|
| 78 | DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO               = 0x00004000, | 
|---|
| 79 | DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION           = 0x00008000, | 
|---|
| 80 | DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01                  = 0x00010000, | 
|---|
| 81 | DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP       = 0x00020000, | 
|---|
| 82 | DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY             = 0x00040000, | 
|---|
| 83 | DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3                  = 0x00080000, | 
|---|
| 84 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V5                = 0x00100000, | 
|---|
| 85 | DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2            = 0x00200000, | 
|---|
| 86 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6                = 0x00400000, | 
|---|
| 87 | DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS               = 0x00800000, | 
|---|
| 88 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8                = 0x01000000, | 
|---|
| 89 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5              = 0x02000000, | 
|---|
| 90 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6              = 0x04000000, | 
|---|
| 91 | /* | 
|---|
| 92 | * the following 3 have the same value | 
|---|
| 93 | * repadmin.exe /bind says that | 
|---|
| 94 | */ | 
|---|
| 95 | DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3            = 0x08000000, | 
|---|
| 96 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7              = 0x08000000, | 
|---|
| 97 | DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT               = 0x08000000, | 
|---|
| 98 | DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS             = 0x10000000, | 
|---|
| 99 | DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10               = 0x20000000, | 
|---|
| 100 | DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART2              = 0x40000000, | 
|---|
| 101 | DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART3              = 0x80000000 | 
|---|
| 102 | } drsuapi_SupportedExtensions; | 
|---|
| 103 |  | 
|---|
| 104 | typedef [bitmap32bit] bitmap { | 
|---|
| 105 | DRSUAPI_SUPPORTED_EXTENSION_ADAM                        = 0x00000001, | 
|---|
| 106 | DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2                    = 0x00000002, | 
|---|
| 107 | DRSUAPI_SUPPORTED_EXTENSION_RECYCLE_BIN                 = 0x00000004 | 
|---|
| 108 | } drsuapi_SupportedExtensionsExt; | 
|---|
| 109 |  | 
|---|
| 110 | /* this is used by w2k */ | 
|---|
| 111 | typedef struct { | 
|---|
| 112 | drsuapi_SupportedExtensions supported_extensions; | 
|---|
| 113 | GUID site_guid; | 
|---|
| 114 | uint32 pid; | 
|---|
| 115 | } drsuapi_DsBindInfo24; | 
|---|
| 116 |  | 
|---|
| 117 | /* this is used by w2k3 */ | 
|---|
| 118 | typedef struct { | 
|---|
| 119 | drsuapi_SupportedExtensions supported_extensions; | 
|---|
| 120 | GUID site_guid; | 
|---|
| 121 | uint32 pid; | 
|---|
| 122 | uint32 repl_epoch; | 
|---|
| 123 | } drsuapi_DsBindInfo28; | 
|---|
| 124 |  | 
|---|
| 125 | /* this is used by w2k8 */ | 
|---|
| 126 | typedef struct { | 
|---|
| 127 | drsuapi_SupportedExtensions supported_extensions; | 
|---|
| 128 | GUID site_guid; | 
|---|
| 129 | uint32 pid; | 
|---|
| 130 | uint32 repl_epoch; | 
|---|
| 131 | drsuapi_SupportedExtensionsExt supported_extensions_ext; | 
|---|
| 132 | GUID config_dn_guid; | 
|---|
| 133 | } drsuapi_DsBindInfo48; | 
|---|
| 134 |  | 
|---|
| 135 | typedef struct { | 
|---|
| 136 | [flag(NDR_REMAINING)] DATA_BLOB info; | 
|---|
| 137 | } drsuapi_DsBindInfoFallBack; | 
|---|
| 138 |  | 
|---|
| 139 | typedef [nodiscriminant] union { | 
|---|
| 140 | [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24; | 
|---|
| 141 | [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28; | 
|---|
| 142 | [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48; | 
|---|
| 143 | [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack; | 
|---|
| 144 | } drsuapi_DsBindInfo; | 
|---|
| 145 |  | 
|---|
| 146 | /* the drsuapi_DsBindInfoCtr was this before | 
|---|
| 147 | * typedef [flag(NDR_PAHEX)] struct { | 
|---|
| 148 | *      [range(1,10000)] uint32 length; | 
|---|
| 149 | *      [size_is(length)] uint8 data[]; | 
|---|
| 150 | * } drsuapi_DsBindInfo; | 
|---|
| 151 | * | 
|---|
| 152 | * but we don't want the caller to manually decode this blob, | 
|---|
| 153 | * so we're doing it here | 
|---|
| 154 | */ | 
|---|
| 155 |  | 
|---|
| 156 | typedef struct { | 
|---|
| 157 | [range(1,10000)] uint32 length; | 
|---|
| 158 | [switch_is(length)] drsuapi_DsBindInfo info; | 
|---|
| 159 | } drsuapi_DsBindInfoCtr; | 
|---|
| 160 |  | 
|---|
| 161 | /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work | 
|---|
| 162 | * | 
|---|
| 163 | * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04 | 
|---|
| 164 | */ | 
|---|
| 165 | const char *DRSUAPI_DS_BIND_GUID = "e24d201a-4fd6-11d1-a3da-0000f875ae0d"; | 
|---|
| 166 | /* | 
|---|
| 167 | * this magic guid are needed to fetch the whole tree with drsuapi_DsGetNCChanges() | 
|---|
| 168 | * as administrator and this values are also used in the destination_dsa_guid field | 
|---|
| 169 | * of drsuapi_DsGetNCChangesReq5/8 and the source_dsa_guid is zero. | 
|---|
| 170 | */ | 
|---|
| 171 | const char *DRSUAPI_DS_BIND_GUID_W2K    = "6abec3d1-3054-41c8-a362-5a0c5b7d5d71"; | 
|---|
| 172 | const char *DRSUAPI_DS_BIND_GUID_W2K3   = "6afab99c-6e26-464a-975f-f58f105218bc"; | 
|---|
| 173 |  | 
|---|
| 174 | [public] WERROR drsuapi_DsBind( | 
|---|
| 175 | [in,unique]         GUID *bind_guid, | 
|---|
| 176 | [in,out,unique]    drsuapi_DsBindInfoCtr *bind_info, | 
|---|
| 177 | [out]   policy_handle *bind_handle | 
|---|
| 178 | ); | 
|---|
| 179 |  | 
|---|
| 180 | /*****************/ | 
|---|
| 181 | /* Function 0x01 */ | 
|---|
| 182 | WERROR drsuapi_DsUnbind( | 
|---|
| 183 | [in,out] policy_handle *bind_handle | 
|---|
| 184 | ); | 
|---|
| 185 |  | 
|---|
| 186 | /*****************/ | 
|---|
| 187 | /* Function 0x02 */ | 
|---|
| 188 | typedef [public,gensize] struct { | 
|---|
| 189 | [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags)-4)] uint32 __ndr_size; | 
|---|
| 190 | [value(ndr_size_dom_sid28(&sid, ndr->flags))]  uint32 __ndr_size_sid; | 
|---|
| 191 | GUID guid; | 
|---|
| 192 | dom_sid28 sid; | 
|---|
| 193 | [value(strlen_m(dn))] uint32 __ndr_size_dn; | 
|---|
| 194 | [charset(UTF16),size_is(__ndr_size_dn+1)] uint16 dn[]; | 
|---|
| 195 | } drsuapi_DsReplicaObjectIdentifier; | 
|---|
| 196 |  | 
|---|
| 197 | typedef struct { | 
|---|
| 198 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 199 | GUID source_dsa_guid; | 
|---|
| 200 | astring *source_dsa_dns; /* Source DSA dns_name in <guid>._msdcs.<domain_dns> form */ | 
|---|
| 201 | drsuapi_DrsOptions options; | 
|---|
| 202 | } drsuapi_DsReplicaSyncRequest1; | 
|---|
| 203 |  | 
|---|
| 204 | typedef [switch_type(uint32)] union { | 
|---|
| 205 | [case(1)] drsuapi_DsReplicaSyncRequest1 req1; | 
|---|
| 206 | } drsuapi_DsReplicaSyncRequest; | 
|---|
| 207 |  | 
|---|
| 208 | WERROR drsuapi_DsReplicaSync( | 
|---|
| 209 | [in] policy_handle *bind_handle, | 
|---|
| 210 | [in] uint32 level, | 
|---|
| 211 | [in,switch_is(level)] drsuapi_DsReplicaSyncRequest *req | 
|---|
| 212 | ); | 
|---|
| 213 |  | 
|---|
| 214 | /*****************/ | 
|---|
| 215 | /* Function 0x03 */ | 
|---|
| 216 | typedef [public] struct { | 
|---|
| 217 | hyper tmp_highest_usn; /* updated after each object update */ | 
|---|
| 218 | hyper reserved_usn; | 
|---|
| 219 | hyper highest_usn; /* updated after a full replication cycle */ | 
|---|
| 220 | } drsuapi_DsReplicaHighWaterMark; | 
|---|
| 221 |  | 
|---|
| 222 | typedef [public] struct { | 
|---|
| 223 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 224 | hyper highest_usn;  /* updated after a full replication cycle */ | 
|---|
| 225 | } drsuapi_DsReplicaCursor; | 
|---|
| 226 |  | 
|---|
| 227 | typedef struct { | 
|---|
| 228 | [value(1)] uint32 version; | 
|---|
| 229 | [value(0)] uint32 reserved1; | 
|---|
| 230 | [range(0,0x100000)] uint32 count; | 
|---|
| 231 | [value(0)] uint32 reserved2; | 
|---|
| 232 | [size_is(count)] drsuapi_DsReplicaCursor cursors[]; | 
|---|
| 233 | } drsuapi_DsReplicaCursorCtrEx; | 
|---|
| 234 |  | 
|---|
| 235 | typedef [flag(NDR_PAHEX),v1_enum] enum { | 
|---|
| 236 | DRSUAPI_EXOP_NONE                               = 0x00000000, | 
|---|
| 237 | DRSUAPI_EXOP_FSMO_REQ_ROLE                      = 0x00000001, | 
|---|
| 238 | DRSUAPI_EXOP_FSMO_RID_ALLOC                     = 0x00000002, | 
|---|
| 239 | DRSUAPI_EXOP_FSMO_RID_REQ_ROLE                  = 0x00000003, | 
|---|
| 240 | DRSUAPI_EXOP_FSMO_REQ_PDC                       = 0x00000004, | 
|---|
| 241 | DRSUAPI_EXOP_FSMO_ABANDON_ROLE                  = 0x00000005, | 
|---|
| 242 | DRSUAPI_EXOP_REPL_OBJ                           = 0x00000006, | 
|---|
| 243 | DRSUAPI_EXOP_REPL_SECRET                        = 0x00000007 | 
|---|
| 244 | } drsuapi_DsExtendedOperation; | 
|---|
| 245 |  | 
|---|
| 246 | typedef [flag(NDR_PAHEX),v1_enum] enum { | 
|---|
| 247 | DRSUAPI_EXOP_ERR_NONE                           = 0x00000000, | 
|---|
| 248 | DRSUAPI_EXOP_ERR_SUCCESS                        = 0x00000001, | 
|---|
| 249 | DRSUAPI_EXOP_ERR_UNKNOWN_OP                     = 0x00000002, | 
|---|
| 250 | DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER                 = 0x00000003, | 
|---|
| 251 | DRSUAPI_EXOP_ERR_UPDATE_ERR                     = 0x00000004, | 
|---|
| 252 | DRSUAPI_EXOP_ERR_EXCEPTION                      = 0x00000005, | 
|---|
| 253 | DRSUAPI_EXOP_ERR_UNKNOWN_CALLER                 = 0x00000006, | 
|---|
| 254 | DRSUAPI_EXOP_ERR_RID_ALLOC                      = 0x00000007, | 
|---|
| 255 | DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED             = 0x00000008, | 
|---|
| 256 | DRSUAPI_EXOP_ERR_FMSO_PENDING_OP                = 0x00000009, | 
|---|
| 257 | DRSUAPI_EXOP_ERR_MISMATCH                       = 0x0000000A, | 
|---|
| 258 | DRSUAPI_EXOP_ERR_COULDNT_CONTACT                = 0x0000000B, | 
|---|
| 259 | DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES            = 0x0000000C, | 
|---|
| 260 | DRSUAPI_EXOP_ERR_DIR_ERROR                      = 0x0000000D, | 
|---|
| 261 | DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS          = 0x0000000E, | 
|---|
| 262 | DRSUAPI_EXOP_ERR_ACCESS_DENIED                  = 0x0000000F, | 
|---|
| 263 | DRSUAPI_EXOP_ERR_PARAM_ERROR                    = 0x00000010 | 
|---|
| 264 | } drsuapi_DsExtendedError; | 
|---|
| 265 |  | 
|---|
| 266 | typedef struct { | 
|---|
| 267 | GUID destination_dsa_guid; | 
|---|
| 268 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 269 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 270 | drsuapi_DsReplicaHighWaterMark highwatermark; | 
|---|
| 271 | drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; | 
|---|
| 272 | drsuapi_DrsOptions replica_flags; | 
|---|
| 273 | uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ | 
|---|
| 274 | uint32 max_ndr_size; /* w2k3 seems to ignore this */ | 
|---|
| 275 | drsuapi_DsExtendedOperation extended_op; | 
|---|
| 276 | hyper fsmo_info; | 
|---|
| 277 | } drsuapi_DsGetNCChangesRequest5; | 
|---|
| 278 |  | 
|---|
| 279 | /* | 
|---|
| 280 | * In DRSUAPI all attributes with syntax 2.5.5.2 | 
|---|
| 281 | * are identified by uint32 values | 
|---|
| 282 | * | 
|---|
| 283 | * the following table shows the mapping used between the two representations | 
|---|
| 284 | * e.g. - objectClass 'nTDSDSA' has governsID: 1.2.840.113556.1.5.7000.47 | 
|---|
| 285 | *        and a UINT32-ID of '0x0017002F'. | 
|---|
| 286 | *      - so the OID 1.2.840.113556.1.5.7000.47 is splitted into a | 
|---|
| 287 | *        OID-prefix: 1.2.840.113556.1.5.7000 | 
|---|
| 288 | *        and a value: 47 => 0x2F | 
|---|
| 289 | *      - the mapping table gives a UINT32-prefix: 0x00170000 | 
|---|
| 290 | *      - and the UINT32-ID is 0x0017002F = 0x00170000 | 0x2F | 
|---|
| 291 | * | 
|---|
| 292 | * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr | 
|---|
| 293 | * array. The following are the default mappings of w2k3 | 
|---|
| 294 | * | 
|---|
| 295 | * OID-prefix                   => UINT32-Id prefix | 
|---|
| 296 | * | 
|---|
| 297 | * 2.5.4.*                      => 0x00000000 (standard attributes RFC2256 core.schema) | 
|---|
| 298 | * 2.5.6.*                      => 0x00010000 (standard object classes RFC2256 core.schema) | 
|---|
| 299 | * 1.2.840.113556.1.2.*         => 0x00020000 | 
|---|
| 300 | * 1.2.840.113556.1.3.*         => 0x00030000 | 
|---|
| 301 | * 2.5.5.*                      => 0x00080000 (attributeSyntax OID's) | 
|---|
| 302 | * 1.2.840.113556.1.4.*         => 0x00090000 | 
|---|
| 303 | * 1.2.840.113556.1.5.*         => 0x000A0000 | 
|---|
| 304 | * 2.16.840.1.113730.3.*        => 0x00140000 | 
|---|
| 305 | * 0.9.2342.19200300.100.1.*    => 0x00150000 | 
|---|
| 306 | * 2.16.840.1.113730.3.1.*      => 0x00160000 | 
|---|
| 307 | * 1.2.840.113556.1.5.7000.*    => 0x00170000 | 
|---|
| 308 | * 2.5.21.*                     => 0x00180000 (attrs for SubSchema) | 
|---|
| 309 | * 2.5.18.*                     => 0x00190000 (createTimeStamp,modifyTimeStamp, SubSchema) | 
|---|
| 310 | * 2.5.20.*                     => 0x001A0000 | 
|---|
| 311 | * 1.3.6.1.4.1.1466.101.119.*   => 0x001B0000 (dynamicObject, entryTTL) | 
|---|
| 312 | * 2.16.840.1.113730.3.2.*      => 0x001C0000 | 
|---|
| 313 | * 1.3.6.1.4.1.250.1.*          => 0x001D0000 | 
|---|
| 314 | * 1.2.840.113549.1.9.*         => 0x001E0000 (unstructuredAddress,unstructuredName) | 
|---|
| 315 | * 0.9.2342.19200300.100.4.*    => 0x001F0000 | 
|---|
| 316 | * | 
|---|
| 317 | * Here's a list of used 'attributeSyntax' OID's | 
|---|
| 318 | * | 
|---|
| 319 | * 2.5.5.1      => Object(DS-DN) string | 
|---|
| 320 | *                 struct drsuapi_DsObjectIdentifier3 | 
|---|
| 321 | * | 
|---|
| 322 | * 2.5.5.2      => OID-string | 
|---|
| 323 | *              => all values are represented as uint32 values in drsuapi | 
|---|
| 324 | *              => governsID, attributeID and attributeSyntax returned as OID-Strings in LDAP | 
|---|
| 325 | *              => mayContain, mustContain and all other attributes with 2.5.5.2 syntax | 
|---|
| 326 | *                 are returned as attribute names | 
|---|
| 327 | * | 
|---|
| 328 | * 2.5.5.4      => String(Teletex) case-insensitive string with teletex charset | 
|---|
| 329 | * | 
|---|
| 330 | * 2.5.5.5      => String(IA5) case-sensitive string | 
|---|
| 331 | * | 
|---|
| 332 | * 2.5.5.6      => String(Numeric) | 
|---|
| 333 | *              => eg. internationalISDNNumber | 
|---|
| 334 | * | 
|---|
| 335 | * 2.5.5.7      => Object(DN-Binary) B:<byte count>:<bytes>:<object DN> | 
|---|
| 336 | *              => e.g. wellKnownObjects | 
|---|
| 337 | * | 
|---|
| 338 | * 2.5.5.8      => BOOL | 
|---|
| 339 | * | 
|---|
| 340 | * 2.5.5.9      => int32 | 
|---|
| 341 | * | 
|---|
| 342 | * 2.5.5.10     => DATA_BLOB | 
|---|
| 343 | *              => struct GUID | 
|---|
| 344 | * | 
|---|
| 345 | * 2.5.5.11     => LDAP timestring | 
|---|
| 346 | *              => NTTIME_1sec | 
|---|
| 347 | * | 
|---|
| 348 | * 2.5.5.12     => String(Unicode) case-insensitive string | 
|---|
| 349 | *              => 'standard strings' | 
|---|
| 350 | * | 
|---|
| 351 | * 2.5.5.13     => Object(Presentation-Address) string | 
|---|
| 352 | *              => used in objectClass applicationEntity | 
|---|
| 353 | * | 
|---|
| 354 | * 2.5.5.14     => Object(DN-String) S:<char count>:<string>:<object DN> | 
|---|
| 355 | *              => not used | 
|---|
| 356 | * | 
|---|
| 357 | * 2.5.5.15     => ntSecurityDescriptor | 
|---|
| 358 | * | 
|---|
| 359 | * 2.5.5.16     => int64 | 
|---|
| 360 | * | 
|---|
| 361 | * 2.5.5.17     => dom_sid | 
|---|
| 362 | */ | 
|---|
| 363 | typedef [noprint] struct { | 
|---|
| 364 | [range(0,10000)] uint32 length; | 
|---|
| 365 | [size_is(length)] uint8 *binary_oid; /* partial-binary-OID encoded with asn1_write_partial_OID_String() */ | 
|---|
| 366 | } drsuapi_DsReplicaOID; | 
|---|
| 367 |  | 
|---|
| 368 | typedef struct { | 
|---|
| 369 | uint32 id_prefix; | 
|---|
| 370 | drsuapi_DsReplicaOID oid; | 
|---|
| 371 | } drsuapi_DsReplicaOIDMapping; | 
|---|
| 372 |  | 
|---|
| 373 | typedef [public] struct { | 
|---|
| 374 | [range(0,0x100000)] uint32 num_mappings; | 
|---|
| 375 | [size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings; | 
|---|
| 376 | } drsuapi_DsReplicaOIDMapping_Ctr; | 
|---|
| 377 |  | 
|---|
| 378 | typedef [flag(NDR_PAHEX),v1_enum] enum { | 
|---|
| 379 | DRSUAPI_OBJECTCLASS_top                 = 0x00010000, | 
|---|
| 380 | DRSUAPI_OBJECTCLASS_classSchema         = 0x0003000d, | 
|---|
| 381 | DRSUAPI_OBJECTCLASS_attributeSchema     = 0x0003000e | 
|---|
| 382 | } drsuapi_DsObjectClassId; | 
|---|
| 383 |  | 
|---|
| 384 | typedef [flag(NDR_PAHEX),v1_enum,public] enum { | 
|---|
| 385 | DRSUAPI_ATTID_objectClass                       = 0x00000000, | 
|---|
| 386 | DRSUAPI_ATTID_cn                                = 0x00000003, | 
|---|
| 387 | DRSUAPI_ATTID_ou                                = 0x0000000b, | 
|---|
| 388 | DRSUAPI_ATTID_description                       = 0x0000000d, | 
|---|
| 389 | DRSUAPI_ATTID_member                            = 0x0000001f, | 
|---|
| 390 | DRSUAPI_ATTID_instanceType                      = 0x00020001, | 
|---|
| 391 | DRSUAPI_ATTID_whenCreated                       = 0x00020002, | 
|---|
| 392 | DRSUAPI_ATTID_possSuperiors                     = 0x00020008, | 
|---|
| 393 | DRSUAPI_ATTID_displayName                       = 0x0002000d, | 
|---|
| 394 | DRSUAPI_ATTID_hasMasterNCs                      = 0x0002000e, | 
|---|
| 395 | DRSUAPI_ATTID_subClassOf                        = 0x00020015, | 
|---|
| 396 | DRSUAPI_ATTID_governsID                         = 0x00020016, | 
|---|
| 397 | DRSUAPI_ATTID_mustContain                       = 0x00020018, | 
|---|
| 398 | DRSUAPI_ATTID_mayContain                        = 0x00020019, | 
|---|
| 399 | DRSUAPI_ATTID_rDNAttId                          = 0x0002001A, | 
|---|
| 400 | DRSUAPI_ATTID_attributeID                       = 0x0002001e, | 
|---|
| 401 | DRSUAPI_ATTID_attributeSyntax                   = 0x00020020, | 
|---|
| 402 | DRSUAPI_ATTID_isSingleValued                    = 0x00020021, | 
|---|
| 403 | DRSUAPI_ATTID_rangeLower                        = 0x00020022, | 
|---|
| 404 | DRSUAPI_ATTID_rangeUpper                        = 0x00020023, | 
|---|
| 405 | DRSUAPI_ATTID_dMDLocation                       = 0x00020024, | 
|---|
| 406 | DRSUAPI_ATTID_isDeleted                         = 0x00020030, | 
|---|
| 407 | DRSUAPI_ATTID_objectVersion                     = 0x0002004c, | 
|---|
| 408 | DRSUAPI_ATTID_invocationId                      = 0x00020073, | 
|---|
| 409 | DRSUAPI_ATTID_showInAdvancedViewOnly            = 0x000200a9, | 
|---|
| 410 | DRSUAPI_ATTID_adminDisplayName                  = 0x000200c2, | 
|---|
| 411 | DRSUAPI_ATTID_adminDescription                  = 0x000200e2, | 
|---|
| 412 | DRSUAPI_ATTID_oMSyntax                          = 0x000200e7, | 
|---|
| 413 | DRSUAPI_ATTID_ntSecurityDescriptor              = 0x00020119, | 
|---|
| 414 | DRSUAPI_ATTID_searchFlags                       = 0x0002014e, | 
|---|
| 415 | DRSUAPI_ATTID_auxiliaryClass                    = 0x0002015f, | 
|---|
| 416 | DRSUAPI_ATTID_lDAPDisplayName                   = 0x000201cc, | 
|---|
| 417 | DRSUAPI_ATTID_name                              = 0x00090001, | 
|---|
| 418 | DRSUAPI_ATTID_userAccountControl                = 0x00090008, | 
|---|
| 419 | DRSUAPI_ATTID_badPwdCount                       = 0x0009000c, | 
|---|
| 420 | DRSUAPI_ATTID_codePage                          = 0x00090010, | 
|---|
| 421 | DRSUAPI_ATTID_countryCode                       = 0x00090019, | 
|---|
| 422 | DRSUAPI_ATTID_currentValue                      = 0x0009001b, | 
|---|
| 423 | DRSUAPI_ATTID_homeDirectory                     = 0x0009002c, | 
|---|
| 424 | DRSUAPI_ATTID_homeDrive                         = 0x0009002d, | 
|---|
| 425 | DRSUAPI_ATTID_lastLogoff                        = 0x00090033, | 
|---|
| 426 | DRSUAPI_ATTID_lastLogon                         = 0x00090034, | 
|---|
| 427 | DRSUAPI_ATTID_dBCSPwd                           = 0x00090037,/* lmPwdHash */ | 
|---|
| 428 | DRSUAPI_ATTID_scriptPath                        = 0x0009003e, | 
|---|
| 429 | DRSUAPI_ATTID_logonHours                        = 0x00090040, | 
|---|
| 430 | DRSUAPI_ATTID_userWorkstations                  = 0x00090056, | 
|---|
| 431 | DRSUAPI_ATTID_unicodePwd                        = 0x0009005a,/* ntPwdHash */ | 
|---|
| 432 | DRSUAPI_ATTID_ntPwdHistory                      = 0x0009005e, | 
|---|
| 433 | DRSUAPI_ATTID_pwdLastSet                        = 0x00090060, | 
|---|
| 434 | DRSUAPI_ATTID_primaryGroupID                    = 0x00090062, | 
|---|
| 435 | DRSUAPI_ATTID_priorValue                        = 0x00090064, | 
|---|
| 436 | DRSUAPI_ATTID_supplementalCredentials           = 0x0009007d, | 
|---|
| 437 | DRSUAPI_ATTID_trustAuthIncoming                 = 0x00090081, | 
|---|
| 438 | DRSUAPI_ATTID_trustAuthOutgoing                 = 0x00090087, | 
|---|
| 439 | DRSUAPI_ATTID_userParameters                    = 0x0009008a, | 
|---|
| 440 | DRSUAPI_ATTID_profilePath                       = 0x0009008b, | 
|---|
| 441 | DRSUAPI_ATTID_objectSid                         = 0x00090092, | 
|---|
| 442 | DRSUAPI_ATTID_schemaIDGUID                      = 0x00090094, | 
|---|
| 443 | DRSUAPI_ATTID_comment                           = 0x0009009C,/* User-Comment */ | 
|---|
| 444 | DRSUAPI_ATTID_accountExpires                    = 0x0009009f, | 
|---|
| 445 | DRSUAPI_ATTID_lmPwdHistory                      = 0x000900a0, | 
|---|
| 446 | DRSUAPI_ATTID_logonCount                        = 0x000900a9, | 
|---|
| 447 | DRSUAPI_ATTID_systemPossSuperiors               = 0x000900c3, | 
|---|
| 448 | DRSUAPI_ATTID_systemMayContain                  = 0x000900c4, | 
|---|
| 449 | DRSUAPI_ATTID_systemMustContain                 = 0x000900c5, | 
|---|
| 450 | DRSUAPI_ATTID_systemAuxiliaryClass              = 0x000900c6, | 
|---|
| 451 | DRSUAPI_ATTID_sAMAccountName                    = 0x000900dd, | 
|---|
| 452 | DRSUAPI_ATTID_sAMAccountType                    = 0x0009012e, | 
|---|
| 453 | DRSUAPI_ATTID_options                           = 0x00090133, | 
|---|
| 454 | DRSUAPI_ATTID_fSMORoleOwner                     = 0x00090171, | 
|---|
| 455 | DRSUAPI_ATTID_systemFlags                       = 0x00090177, | 
|---|
| 456 | DRSUAPI_ATTID_serverReference                   = 0x00090203, | 
|---|
| 457 | DRSUAPI_ATTID_serverReferenceBL                 = 0x00090204, | 
|---|
| 458 | DRSUAPI_ATTID_initialAuthIncoming               = 0x0009021b, | 
|---|
| 459 | DRSUAPI_ATTID_initialAuthOutgoing               = 0x0009021c, | 
|---|
| 460 | DRSUAPI_ATTID_wellKnownObjects                  = 0x0009026a, | 
|---|
| 461 | DRSUAPI_ATTID_dNSHostName                       = 0x0009026b, | 
|---|
| 462 | DRSUAPI_ATTID_isMemberOfPartialAttributeSet     = 0x0009027f, | 
|---|
| 463 | DRSUAPI_ATTID_userPrincipalName                 = 0x00090290, | 
|---|
| 464 | DRSUAPI_ATTID_groupType                         = 0x000902ee, | 
|---|
| 465 | DRSUAPI_ATTID_servicePrincipalName              = 0x00090303, | 
|---|
| 466 | DRSUAPI_ATTID_lastKnownParent                   = 0x0009030d, | 
|---|
| 467 | DRSUAPI_ATTID_objectCategory                    = 0x0009030e, | 
|---|
| 468 | DRSUAPI_ATTID_gPLink                            = 0x0009037b, | 
|---|
| 469 | DRSUAPI_ATTID_transportAddressAttribute         = 0x0009037f, | 
|---|
| 470 | DRSUAPI_ATTID_msDS_Behavior_Version             = 0x000905b3, | 
|---|
| 471 | DRSUAPI_ATTID_msDS_KeyVersionNumber             = 0x000906f6, | 
|---|
| 472 | DRSUAPI_ATTID_msDS_HasDomainNCs                 = 0x0009071c, | 
|---|
| 473 | DRSUAPI_ATTID_msDS_hasMasterNCs                 = 0x0009072c, | 
|---|
| 474 | DRSUAPI_ATTID_isRecycled                        = 0x0009080a, | 
|---|
| 475 |  | 
|---|
| 476 | DRSUAPI_ATTID_INVALID                           = 0xFFFFFFFF | 
|---|
| 477 | } drsuapi_DsAttributeId; | 
|---|
| 478 |  | 
|---|
| 479 | typedef struct { | 
|---|
| 480 | [value(1)] uint32 version; | 
|---|
| 481 | [value(0)] uint32 reserved1; | 
|---|
| 482 | [range(1,0x100000)] uint32 num_attids; | 
|---|
| 483 | [size_is(num_attids)] drsuapi_DsAttributeId attids[]; | 
|---|
| 484 | } drsuapi_DsPartialAttributeSet; | 
|---|
| 485 |  | 
|---|
| 486 | typedef struct { | 
|---|
| 487 | GUID destination_dsa_guid; | 
|---|
| 488 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 489 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 490 | drsuapi_DsReplicaHighWaterMark highwatermark; | 
|---|
| 491 | drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; | 
|---|
| 492 | drsuapi_DrsOptions replica_flags; | 
|---|
| 493 | uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ | 
|---|
| 494 | uint32 max_ndr_size; /* w2k3 seems to ignore this */ | 
|---|
| 495 | drsuapi_DsExtendedOperation extended_op; | 
|---|
| 496 | hyper fsmo_info; | 
|---|
| 497 | drsuapi_DsPartialAttributeSet *partial_attribute_set; | 
|---|
| 498 | drsuapi_DsPartialAttributeSet *partial_attribute_set_ex; | 
|---|
| 499 | drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; | 
|---|
| 500 | } drsuapi_DsGetNCChangesRequest8; | 
|---|
| 501 |  | 
|---|
| 502 | typedef struct { | 
|---|
| 503 | GUID destination_dsa_guid; | 
|---|
| 504 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 505 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 506 | drsuapi_DsReplicaHighWaterMark highwatermark; | 
|---|
| 507 | drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; | 
|---|
| 508 | drsuapi_DrsOptions replica_flags; | 
|---|
| 509 | uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ | 
|---|
| 510 | uint32 max_ndr_size; /* w2k3 seems to ignore this */ | 
|---|
| 511 | drsuapi_DsExtendedOperation extended_op; | 
|---|
| 512 | hyper fsmo_info; | 
|---|
| 513 | drsuapi_DsPartialAttributeSet *partial_attribute_set; | 
|---|
| 514 | drsuapi_DsPartialAttributeSet *partial_attribute_set_ex; | 
|---|
| 515 | drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; | 
|---|
| 516 | uint32 more_flags; | 
|---|
| 517 | } drsuapi_DsGetNCChangesRequest10; | 
|---|
| 518 |  | 
|---|
| 519 | typedef [switch_type(uint32)] union { | 
|---|
| 520 | [case(5)] drsuapi_DsGetNCChangesRequest5 req5; | 
|---|
| 521 | [case(8)] drsuapi_DsGetNCChangesRequest8 req8; | 
|---|
| 522 | [case(10)] drsuapi_DsGetNCChangesRequest10 req10; | 
|---|
| 523 | } drsuapi_DsGetNCChangesRequest; | 
|---|
| 524 |  | 
|---|
| 525 | typedef [public] struct { | 
|---|
| 526 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 527 | hyper highest_usn;  /* updated after a full replication cycle */ | 
|---|
| 528 | NTTIME last_sync_success; | 
|---|
| 529 | } drsuapi_DsReplicaCursor2; | 
|---|
| 530 |  | 
|---|
| 531 | typedef struct { | 
|---|
| 532 | [value(2)] uint32 version; | 
|---|
| 533 | [value(0)] uint32 reserved1; | 
|---|
| 534 | [range(0,0x100000)] uint32 count; | 
|---|
| 535 | [value(0)] uint32 reserved2; | 
|---|
| 536 | [size_is(count)] drsuapi_DsReplicaCursor2 cursors[]; | 
|---|
| 537 | } drsuapi_DsReplicaCursor2CtrEx; | 
|---|
| 538 |  | 
|---|
| 539 | /* Generic DATA_BLOB values */ | 
|---|
| 540 | typedef struct { | 
|---|
| 541 | [range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size; | 
|---|
| 542 | DATA_BLOB *blob; | 
|---|
| 543 | } drsuapi_DsAttributeValue; | 
|---|
| 544 |  | 
|---|
| 545 | typedef struct { | 
|---|
| 546 | [range(0,10485760)] uint32 num_values; | 
|---|
| 547 | [size_is(num_values)] drsuapi_DsAttributeValue *values; | 
|---|
| 548 | } drsuapi_DsAttributeValueCtr; | 
|---|
| 549 |  | 
|---|
| 550 | /* DN String values */ | 
|---|
| 551 | typedef [public,gensize] struct { | 
|---|
| 552 | [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))] uint32 __ndr_size; | 
|---|
| 553 | [value(ndr_size_dom_sid28(&sid,ndr->flags))]  uint32 __ndr_size_sid; | 
|---|
| 554 | GUID guid; | 
|---|
| 555 | dom_sid28 sid; | 
|---|
| 556 | [value(strlen_m(dn))] uint32 __ndr_size_dn; | 
|---|
| 557 | [charset(UTF16)] uint16 dn[__ndr_size_dn+1]; | 
|---|
| 558 | } drsuapi_DsReplicaObjectIdentifier3; | 
|---|
| 559 |  | 
|---|
| 560 | typedef [public] struct { | 
|---|
| 561 | [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->flags))] uint32 __ndr_size; | 
|---|
| 562 | [value(ndr_size_dom_sid28(&sid,ndr->flags))]  uint32 __ndr_size_sid; | 
|---|
| 563 | GUID guid; | 
|---|
| 564 | dom_sid28 sid; | 
|---|
| 565 | [value(strlen_m(dn))] uint32 __ndr_size_dn; | 
|---|
| 566 | [charset(UTF16)] uint16 dn[__ndr_size_dn+1]; | 
|---|
| 567 | [value(binary.length + 4)] uint32 __ndr_size_binary; | 
|---|
| 568 | [flag(NDR_REMAINING)] DATA_BLOB binary; | 
|---|
| 569 | } drsuapi_DsReplicaObjectIdentifier3Binary; | 
|---|
| 570 |  | 
|---|
| 571 | typedef [public,noprint] struct { | 
|---|
| 572 | drsuapi_DsAttributeId attid; | 
|---|
| 573 | drsuapi_DsAttributeValueCtr value_ctr; | 
|---|
| 574 | } drsuapi_DsReplicaAttribute; | 
|---|
| 575 |  | 
|---|
| 576 | typedef struct { | 
|---|
| 577 | [range(0,1048576)] uint32 num_attributes; | 
|---|
| 578 | [size_is(num_attributes)]  drsuapi_DsReplicaAttribute *attributes; | 
|---|
| 579 | } drsuapi_DsReplicaAttributeCtr; | 
|---|
| 580 |  | 
|---|
| 581 | typedef [public] bitmap { | 
|---|
| 582 | DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER   = 0x00000001, | 
|---|
| 583 | DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC       = 0x00000002, | 
|---|
| 584 | DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY = 0x00010000 | 
|---|
| 585 | } drsuapi_DsReplicaObjectFlags; | 
|---|
| 586 |  | 
|---|
| 587 | typedef [public] struct { | 
|---|
| 588 | drsuapi_DsReplicaObjectIdentifier *identifier; | 
|---|
| 589 | drsuapi_DsReplicaObjectFlags flags; | 
|---|
| 590 | drsuapi_DsReplicaAttributeCtr attribute_ctr; | 
|---|
| 591 | } drsuapi_DsReplicaObject; | 
|---|
| 592 |  | 
|---|
| 593 | typedef struct { | 
|---|
| 594 | uint32 version; | 
|---|
| 595 | NTTIME_1sec originating_change_time; | 
|---|
| 596 | GUID originating_invocation_id; | 
|---|
| 597 | hyper originating_usn; | 
|---|
| 598 | } drsuapi_DsReplicaMetaData; | 
|---|
| 599 |  | 
|---|
| 600 | typedef [public] struct { | 
|---|
| 601 | [range(0,1048576)] uint32 count; | 
|---|
| 602 | [size_is(count)] drsuapi_DsReplicaMetaData meta_data[]; | 
|---|
| 603 | } drsuapi_DsReplicaMetaDataCtr; | 
|---|
| 604 |  | 
|---|
| 605 | typedef [public,noprint] struct { | 
|---|
| 606 | drsuapi_DsReplicaObjectListItemEx *next_object; | 
|---|
| 607 | drsuapi_DsReplicaObject object; | 
|---|
| 608 | boolean32 is_nc_prefix; | 
|---|
| 609 | GUID *parent_object_guid; | 
|---|
| 610 | drsuapi_DsReplicaMetaDataCtr *meta_data_ctr; | 
|---|
| 611 | } drsuapi_DsReplicaObjectListItemEx; | 
|---|
| 612 |  | 
|---|
| 613 | typedef [public,gensize] struct { | 
|---|
| 614 | GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */ | 
|---|
| 615 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 616 | drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 617 | drsuapi_DsReplicaHighWaterMark old_highwatermark; | 
|---|
| 618 | drsuapi_DsReplicaHighWaterMark new_highwatermark; | 
|---|
| 619 | drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; | 
|---|
| 620 | drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; | 
|---|
| 621 | drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */ | 
|---|
| 622 | uint32 object_count; | 
|---|
| 623 | /* this +55 is sometimes +56, so I don't know where this comes from... --metze */ | 
|---|
| 624 | [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] uint32 __ndr_size; | 
|---|
| 625 | drsuapi_DsReplicaObjectListItemEx *first_object; | 
|---|
| 626 | boolean32 more_data; | 
|---|
| 627 | } drsuapi_DsGetNCChangesCtr1; | 
|---|
| 628 |  | 
|---|
| 629 | /* | 
|---|
| 630 | * if the DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE flag | 
|---|
| 631 | * isn't there it means the value is deleted | 
|---|
| 632 | */ | 
|---|
| 633 | typedef [public] bitmap { | 
|---|
| 634 | DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE = 0x00000001 | 
|---|
| 635 | } drsuapi_DsLinkedAttributeFlags; | 
|---|
| 636 |  | 
|---|
| 637 | typedef [public] struct { | 
|---|
| 638 | drsuapi_DsReplicaObjectIdentifier *identifier; | 
|---|
| 639 | drsuapi_DsAttributeId attid; | 
|---|
| 640 | drsuapi_DsAttributeValue value; | 
|---|
| 641 | drsuapi_DsLinkedAttributeFlags flags; | 
|---|
| 642 | NTTIME_1sec originating_add_time; | 
|---|
| 643 | drsuapi_DsReplicaMetaData meta_data; | 
|---|
| 644 | } drsuapi_DsReplicaLinkedAttribute; | 
|---|
| 645 |  | 
|---|
| 646 | /* [MS-DRSR] section 4.1.10.2.11 DRS_MSG_GETCHGREPLY_V6 */ | 
|---|
| 647 | typedef [public,gensize] struct { | 
|---|
| 648 | GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */ | 
|---|
| 649 | GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */ | 
|---|
| 650 | drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 651 | drsuapi_DsReplicaHighWaterMark old_highwatermark; | 
|---|
| 652 | drsuapi_DsReplicaHighWaterMark new_highwatermark; | 
|---|
| 653 | drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector; | 
|---|
| 654 | drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; | 
|---|
| 655 | drsuapi_DsExtendedError extended_ret; | 
|---|
| 656 | uint32 object_count; | 
|---|
| 657 | /* this +55 is sometimes +56, so I don't know where this comes from... --metze */ | 
|---|
| 658 | [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] uint32 __ndr_size; | 
|---|
| 659 | drsuapi_DsReplicaObjectListItemEx *first_object; | 
|---|
| 660 | boolean32 more_data; | 
|---|
| 661 | uint32 nc_object_count; /* estimated amount of objects in the whole NC */ | 
|---|
| 662 | uint32 nc_linked_attributes_count;  /* estimated amount of linked values in the whole NC */ | 
|---|
| 663 | [range(0,1048576)] uint32 linked_attributes_count; | 
|---|
| 664 | [size_is(linked_attributes_count)] drsuapi_DsReplicaLinkedAttribute *linked_attributes; | 
|---|
| 665 | WERROR drs_error; | 
|---|
| 666 | } drsuapi_DsGetNCChangesCtr6; | 
|---|
| 667 |  | 
|---|
| 668 | typedef [public] struct { | 
|---|
| 669 | [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr1 ctr1; | 
|---|
| 670 | } drsuapi_DsGetNCChangesCtr1TS; | 
|---|
| 671 |  | 
|---|
| 672 | typedef [public] struct { | 
|---|
| 673 | [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr6 ctr6; | 
|---|
| 674 | } drsuapi_DsGetNCChangesCtr6TS; | 
|---|
| 675 |  | 
|---|
| 676 | typedef [nopush] struct { | 
|---|
| 677 | uint32 decompressed_length; | 
|---|
| 678 | uint32 compressed_length; | 
|---|
| 679 | [subcontext(4),subcontext_size(compressed_length), | 
|---|
| 680 | compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)] | 
|---|
| 681 | drsuapi_DsGetNCChangesCtr1TS *ts; | 
|---|
| 682 | } drsuapi_DsGetNCChangesMSZIPCtr1; | 
|---|
| 683 |  | 
|---|
| 684 | typedef [nopush] struct { | 
|---|
| 685 | uint32 decompressed_length; | 
|---|
| 686 | uint32 compressed_length; | 
|---|
| 687 | [subcontext(4),subcontext_size(compressed_length), | 
|---|
| 688 | compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)] | 
|---|
| 689 | drsuapi_DsGetNCChangesCtr6TS *ts; | 
|---|
| 690 | } drsuapi_DsGetNCChangesMSZIPCtr6; | 
|---|
| 691 |  | 
|---|
| 692 | typedef [nopush] struct { | 
|---|
| 693 | uint32 decompressed_length; | 
|---|
| 694 | uint32 compressed_length; | 
|---|
| 695 | [subcontext(4),subcontext_size(compressed_length), | 
|---|
| 696 | compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)] | 
|---|
| 697 | drsuapi_DsGetNCChangesCtr1TS *ts; | 
|---|
| 698 | } drsuapi_DsGetNCChangesXPRESSCtr1; | 
|---|
| 699 |  | 
|---|
| 700 | typedef [nopush] struct { | 
|---|
| 701 | uint32 decompressed_length; | 
|---|
| 702 | uint32 compressed_length; | 
|---|
| 703 | [subcontext(4),subcontext_size(compressed_length), | 
|---|
| 704 | compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)] | 
|---|
| 705 | drsuapi_DsGetNCChangesCtr6TS *ts; | 
|---|
| 706 | } drsuapi_DsGetNCChangesXPRESSCtr6; | 
|---|
| 707 |  | 
|---|
| 708 | typedef [enum16bit] enum { | 
|---|
| 709 | DRSUAPI_COMPRESSION_TYPE_MSZIP  = 2, | 
|---|
| 710 | DRSUAPI_COMPRESSION_TYPE_XPRESS = 3 | 
|---|
| 711 | } drsuapi_DsGetNCChangesCompressionType; | 
|---|
| 712 |  | 
|---|
| 713 | typedef [nodiscriminant,flag(NDR_PAHEX)] union { | 
|---|
| 714 | [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))]  drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; | 
|---|
| 715 | [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))]  drsuapi_DsGetNCChangesMSZIPCtr6 mszip6; | 
|---|
| 716 | [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr1 xpress1; | 
|---|
| 717 | [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr6 xpress6; | 
|---|
| 718 | } drsuapi_DsGetNCChangesCompressedCtr; | 
|---|
| 719 |  | 
|---|
| 720 | typedef struct { | 
|---|
| 721 | drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; | 
|---|
| 722 | } drsuapi_DsGetNCChangesCtr2; | 
|---|
| 723 |  | 
|---|
| 724 | typedef struct { | 
|---|
| 725 | [range(0,6)] uint32 level; | 
|---|
| 726 | [range(2,3)] drsuapi_DsGetNCChangesCompressionType type; | 
|---|
| 727 | [switch_is(level | (type<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr; | 
|---|
| 728 | } drsuapi_DsGetNCChangesCtr7; | 
|---|
| 729 |  | 
|---|
| 730 | typedef [switch_type(uint32)] union { | 
|---|
| 731 | [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1; | 
|---|
| 732 | [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2; | 
|---|
| 733 | [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6; | 
|---|
| 734 | [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7; | 
|---|
| 735 | } drsuapi_DsGetNCChangesCtr; | 
|---|
| 736 |  | 
|---|
| 737 | WERROR drsuapi_DsGetNCChanges( | 
|---|
| 738 | [in] policy_handle *bind_handle, | 
|---|
| 739 | [in] uint32 level, | 
|---|
| 740 | [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req, | 
|---|
| 741 | [out,ref] uint32 *level_out, | 
|---|
| 742 | [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr | 
|---|
| 743 | ); | 
|---|
| 744 |  | 
|---|
| 745 | /*****************/ | 
|---|
| 746 | /* Function 0x04 */ | 
|---|
| 747 | /* [MS-DRSR] 4.1.26 */ | 
|---|
| 748 |  | 
|---|
| 749 | typedef struct { | 
|---|
| 750 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 751 | [ref,charset(DOS),string] uint8 *dest_dsa_dns_name; | 
|---|
| 752 | GUID dest_dsa_guid; | 
|---|
| 753 | drsuapi_DrsOptions options; | 
|---|
| 754 | } drsuapi_DsReplicaUpdateRefsRequest1; | 
|---|
| 755 |  | 
|---|
| 756 | typedef [switch_type(uint32)] union { | 
|---|
| 757 | [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1; | 
|---|
| 758 | } drsuapi_DsReplicaUpdateRefsRequest; | 
|---|
| 759 |  | 
|---|
| 760 | WERROR drsuapi_DsReplicaUpdateRefs( | 
|---|
| 761 | [in] policy_handle *bind_handle, | 
|---|
| 762 | [in] uint32 level, | 
|---|
| 763 | [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req | 
|---|
| 764 | ); | 
|---|
| 765 |  | 
|---|
| 766 | /*****************/ | 
|---|
| 767 | /* Function 0x05 */ | 
|---|
| 768 |  | 
|---|
| 769 | typedef struct { | 
|---|
| 770 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 771 | [charset(UTF16),string] uint16 *source_dsa_address; | 
|---|
| 772 | uint8 schedule[84]; | 
|---|
| 773 | drsuapi_DrsOptions options; | 
|---|
| 774 | } drsuapi_DsReplicaAddRequest1; | 
|---|
| 775 |  | 
|---|
| 776 | typedef struct { | 
|---|
| 777 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 778 | drsuapi_DsReplicaObjectIdentifier *source_dsa_dn; | 
|---|
| 779 | drsuapi_DsReplicaObjectIdentifier *transport_dn; | 
|---|
| 780 | [charset(UTF16),string] uint16 *source_dsa_address; | 
|---|
| 781 | uint8 schedule[84]; | 
|---|
| 782 | drsuapi_DrsOptions options; | 
|---|
| 783 | } drsuapi_DsReplicaAddRequest2; | 
|---|
| 784 |  | 
|---|
| 785 | typedef [switch_type(uint32)] union { | 
|---|
| 786 | [case(1)] drsuapi_DsReplicaAddRequest1 req1; | 
|---|
| 787 | [case(2)] drsuapi_DsReplicaAddRequest2 req2; | 
|---|
| 788 | } drsuapi_DsReplicaAddRequest; | 
|---|
| 789 |  | 
|---|
| 790 | WERROR drsuapi_DsReplicaAdd( | 
|---|
| 791 | [in] policy_handle *bind_handle, | 
|---|
| 792 | [in] uint32 level, | 
|---|
| 793 | [in,switch_is(level)] drsuapi_DsReplicaAddRequest req | 
|---|
| 794 | ); | 
|---|
| 795 |  | 
|---|
| 796 |  | 
|---|
| 797 | /*****************/ | 
|---|
| 798 | /* Function 0x06 */ | 
|---|
| 799 | typedef struct { | 
|---|
| 800 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 801 | [charset(UTF16),string] uint16 *source_dsa_address; | 
|---|
| 802 | drsuapi_DrsOptions options; | 
|---|
| 803 | } drsuapi_DsReplicaDelRequest1; | 
|---|
| 804 |  | 
|---|
| 805 | typedef [switch_type(uint32)] union { | 
|---|
| 806 | [case(1)] drsuapi_DsReplicaDelRequest1 req1; | 
|---|
| 807 | } drsuapi_DsReplicaDelRequest; | 
|---|
| 808 |  | 
|---|
| 809 | WERROR drsuapi_DsReplicaDel( | 
|---|
| 810 | [in] policy_handle *bind_handle, | 
|---|
| 811 | [in] uint32 level, | 
|---|
| 812 | [in,switch_is(level)] drsuapi_DsReplicaDelRequest req | 
|---|
| 813 | ); | 
|---|
| 814 |  | 
|---|
| 815 | /*****************/ | 
|---|
| 816 | /* Function 0x07 */ | 
|---|
| 817 |  | 
|---|
| 818 | typedef struct { | 
|---|
| 819 | [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; | 
|---|
| 820 | GUID source_dra; | 
|---|
| 821 | [charset(UTF16),string] uint16 *source_dra_address; | 
|---|
| 822 | uint8 schedule[84]; | 
|---|
| 823 | drsuapi_DrsOptions replica_flags; | 
|---|
| 824 | uint32 modify_fields; | 
|---|
| 825 | drsuapi_DrsOptions options; | 
|---|
| 826 | } drsuapi_DsReplicaModRequest1; | 
|---|
| 827 |  | 
|---|
| 828 | typedef [switch_type(uint32)] union { | 
|---|
| 829 | [case(1)] drsuapi_DsReplicaModRequest1 req1; | 
|---|
| 830 | } drsuapi_DsReplicaModRequest; | 
|---|
| 831 |  | 
|---|
| 832 | WERROR drsuapi_DsReplicaMod( | 
|---|
| 833 | [in] policy_handle *bind_handle, | 
|---|
| 834 | [in] uint32 level, | 
|---|
| 835 | [in,switch_is(level)] drsuapi_DsReplicaModRequest req | 
|---|
| 836 | ); | 
|---|
| 837 |  | 
|---|
| 838 | /*****************/ | 
|---|
| 839 | /* Function 0x08 */ | 
|---|
| 840 | [todo] WERROR DRSUAPI_VERIFY_NAMES(); | 
|---|
| 841 |  | 
|---|
| 842 | /*****************/ | 
|---|
| 843 | /* Function 0x09 */ | 
|---|
| 844 |  | 
|---|
| 845 | /* how are type 4 and 7 different from 2 and 3 ? */ | 
|---|
| 846 | typedef [v1_enum] enum { | 
|---|
| 847 | DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS = 1, | 
|---|
| 848 | DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS  = 2, | 
|---|
| 849 | DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS        = 3, | 
|---|
| 850 | DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 = 4, | 
|---|
| 851 | DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS     = 5, | 
|---|
| 852 | DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS         = 6, | 
|---|
| 853 | DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2       = 7 | 
|---|
| 854 | } drsuapi_DsMembershipType; | 
|---|
| 855 |  | 
|---|
| 856 | typedef struct { | 
|---|
| 857 | NTSTATUS status; | 
|---|
| 858 | [range(0,10000)] uint32 num_memberships; | 
|---|
| 859 | [range(0,10000)] uint32 num_sids; | 
|---|
| 860 | [size_is(num_memberships)] drsuapi_DsReplicaObjectIdentifier **info_array; | 
|---|
| 861 | [size_is(num_memberships)] samr_GroupAttrs *group_attrs; | 
|---|
| 862 | [size_is(num_sids)] dom_sid28 **sids; | 
|---|
| 863 | } drsuapi_DsGetMembershipsCtr1; | 
|---|
| 864 |  | 
|---|
| 865 | typedef [switch_type(uint32)] union { | 
|---|
| 866 | [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1; | 
|---|
| 867 | } drsuapi_DsGetMembershipsCtr; | 
|---|
| 868 |  | 
|---|
| 869 | const int DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR = 0x1; | 
|---|
| 870 |  | 
|---|
| 871 | typedef struct { | 
|---|
| 872 | [range(1,10000)] uint32 count; | 
|---|
| 873 | [size_is(count)] drsuapi_DsReplicaObjectIdentifier **info_array; | 
|---|
| 874 | uint32 flags; | 
|---|
| 875 | [range(1,7)] drsuapi_DsMembershipType type; | 
|---|
| 876 | drsuapi_DsReplicaObjectIdentifier *domain; | 
|---|
| 877 | } drsuapi_DsGetMembershipsRequest1; | 
|---|
| 878 |  | 
|---|
| 879 | typedef [switch_type(uint32)] union { | 
|---|
| 880 | [case(1)] drsuapi_DsGetMembershipsRequest1 req1; | 
|---|
| 881 | } drsuapi_DsGetMembershipsRequest; | 
|---|
| 882 |  | 
|---|
| 883 | WERROR drsuapi_DsGetMemberships( | 
|---|
| 884 | [in] policy_handle *bind_handle, | 
|---|
| 885 | [in] uint32 level, | 
|---|
| 886 | [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req, | 
|---|
| 887 | [out,ref] uint32 *level_out, | 
|---|
| 888 | [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr | 
|---|
| 889 | ); | 
|---|
| 890 |  | 
|---|
| 891 | /*****************/ | 
|---|
| 892 | /* Function 0x0a */ | 
|---|
| 893 | [todo] WERROR DRSUAPI_INTER_DOMAIN_MOVE(); | 
|---|
| 894 |  | 
|---|
| 895 | /*****************/ | 
|---|
| 896 | /* Function 0x0b */ | 
|---|
| 897 | typedef [bitmap32bit] bitmap { | 
|---|
| 898 | DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG             = 0x00000001, | 
|---|
| 899 | DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS        = 0x00000002 | 
|---|
| 900 | } drsuapi_DsGetNT4ChangeLogFlags; | 
|---|
| 901 |  | 
|---|
| 902 | typedef struct { | 
|---|
| 903 | drsuapi_DsGetNT4ChangeLogFlags flags; | 
|---|
| 904 | uint32 preferred_maximum_length; | 
|---|
| 905 | [range(0,0x00A00000)] uint32 restart_length; | 
|---|
| 906 | [size_is(restart_length)] uint8 *restart_data; | 
|---|
| 907 | } drsuapi_DsGetNT4ChangeLogRequest1; | 
|---|
| 908 |  | 
|---|
| 909 | typedef [switch_type(uint32)] union { | 
|---|
| 910 | [case(1)] drsuapi_DsGetNT4ChangeLogRequest1 req1; | 
|---|
| 911 | } drsuapi_DsGetNT4ChangeLogRequest; | 
|---|
| 912 |  | 
|---|
| 913 | typedef struct { | 
|---|
| 914 | [range(0,0x00A00000)] uint32 restart_length; | 
|---|
| 915 | [range(0,0x00A00000)] uint32 log_length; | 
|---|
| 916 | hyper sam_serial_number; | 
|---|
| 917 | NTTIME sam_creation_time; | 
|---|
| 918 | hyper builtin_serial_number; | 
|---|
| 919 | NTTIME builtin_creation_time; | 
|---|
| 920 | hyper lsa_serial_number; | 
|---|
| 921 | NTTIME lsa_creation_time; | 
|---|
| 922 | NTSTATUS status; | 
|---|
| 923 | [size_is(restart_length)] uint8 *restart_data; | 
|---|
| 924 | [size_is(log_length)] uint8 *log_data; | 
|---|
| 925 | } drsuapi_DsGetNT4ChangeLogInfo1; | 
|---|
| 926 |  | 
|---|
| 927 | typedef [switch_type(uint32)] union { | 
|---|
| 928 | [case(1)] drsuapi_DsGetNT4ChangeLogInfo1 info1; | 
|---|
| 929 | } drsuapi_DsGetNT4ChangeLogInfo; | 
|---|
| 930 |  | 
|---|
| 931 | WERROR drsuapi_DsGetNT4ChangeLog( | 
|---|
| 932 | [in] policy_handle *bind_handle, | 
|---|
| 933 | [in] uint32 level, | 
|---|
| 934 | [in,ref] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest *req, | 
|---|
| 935 | [out,ref] uint32 *level_out, | 
|---|
| 936 | [out,ref] [switch_is(*level_out)] drsuapi_DsGetNT4ChangeLogInfo *info | 
|---|
| 937 | ); | 
|---|
| 938 |  | 
|---|
| 939 | /*****************/ | 
|---|
| 940 | /* Function 0x0c */ | 
|---|
| 941 | typedef [v1_enum] enum { | 
|---|
| 942 | DRSUAPI_DS_NAME_STATUS_OK                       = 0, | 
|---|
| 943 | DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR            = 1, | 
|---|
| 944 | DRSUAPI_DS_NAME_STATUS_NOT_FOUND                = 2, | 
|---|
| 945 | DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE               = 3, | 
|---|
| 946 | DRSUAPI_DS_NAME_STATUS_NO_MAPPING               = 4, | 
|---|
| 947 | DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY              = 5, | 
|---|
| 948 | DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING   = 6, | 
|---|
| 949 | DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL           = 7 | 
|---|
| 950 | } drsuapi_DsNameStatus; | 
|---|
| 951 |  | 
|---|
| 952 | typedef [v1_enum] enum { | 
|---|
| 953 | DRSUAPI_DS_NAME_FLAG_NO_FLAGS                   = 0x0, | 
|---|
| 954 | DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY           = 0x1, | 
|---|
| 955 | DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC                 = 0x2, | 
|---|
| 956 | DRSUAPI_DS_NAME_FLAG_GCVERIFY                   = 0x4, | 
|---|
| 957 | DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL             = 0x8 | 
|---|
| 958 | } drsuapi_DsNameFlags; | 
|---|
| 959 |  | 
|---|
| 960 | typedef [v1_enum] enum { | 
|---|
| 961 | DRSUAPI_DS_NAME_FORMAT_UNKNOWN                  = 0x00000000, | 
|---|
| 962 | DRSUAPI_DS_NAME_FORMAT_FQDN_1779                = 0x00000001, | 
|---|
| 963 | DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT              = 0x00000002, | 
|---|
| 964 | DRSUAPI_DS_NAME_FORMAT_DISPLAY                  = 0x00000003, | 
|---|
| 965 | DRSUAPI_DS_NAME_FORMAT_GUID                     = 0x00000006, | 
|---|
| 966 | DRSUAPI_DS_NAME_FORMAT_CANONICAL                = 0x00000007, | 
|---|
| 967 | DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL           = 0x00000008, | 
|---|
| 968 | DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX             = 0x00000009, | 
|---|
| 969 | DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL        = 0x0000000A, | 
|---|
| 970 | DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY       = 0x0000000B, | 
|---|
| 971 | DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN               = 0x0000000C, | 
|---|
| 972 | DRSUAPI_DS_NAME_FORMAT_UPN_AND_ALTSECID         = 0xFFFFFFEF, | 
|---|
| 973 | DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN_EX = 0xFFFFFFF0, | 
|---|
| 974 | DRSUAPI_DS_NAME_FORMAT_LIST_GLOBAL_CATALOG_SERVERS = 0xFFFFFFF1, | 
|---|
| 975 | DRSUAPI_DS_NAME_FORMAT_UPN_FOR_LOGON            = 0xFFFFFFF2, | 
|---|
| 976 | DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_WITH_DCS_IN_SITE = 0xFFFFFFF3, | 
|---|
| 977 | DRSUAPI_DS_NAME_FORMAT_STRING_SID_NAME          = 0xFFFFFFF4, | 
|---|
| 978 | DRSUAPI_DS_NAME_FORMAT_ALT_SECURITY_IDENTITIES_NAME = 0xFFFFFFF5, | 
|---|
| 979 | DRSUAPI_DS_NAME_FORMAT_LIST_NCS                 = 0xFFFFFFF6, | 
|---|
| 980 | DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS             = 0xFFFFFFF7, | 
|---|
| 981 | DRSUAPI_DS_NAME_FORMAT_MAP_SCHEMA_GUID          = 0xFFFFFFF8, | 
|---|
| 982 | DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN = 0xFFFFFFF9, | 
|---|
| 983 | DRSUAPI_DS_NAME_FORMAT_LIST_ROLES               = 0xFFFFFFFA, | 
|---|
| 984 | DRSUAPI_DS_NAME_FORMAT_LIST_INFO_FOR_SERVER     = 0xFFFFFFFB, | 
|---|
| 985 | DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_FOR_DOMAIN_IN_SITE = 0xFFFFFFFC, | 
|---|
| 986 | DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS_IN_SITE     = 0xFFFFFFFD, | 
|---|
| 987 | DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_IN_SITE     = 0xFFFFFFFE, | 
|---|
| 988 | DRSUAPI_DS_NAME_FORMAT_LIST_SITES               = 0xFFFFFFFF | 
|---|
| 989 | } drsuapi_DsNameFormat; | 
|---|
| 990 |  | 
|---|
| 991 | typedef struct { | 
|---|
| 992 | [string,charset(UTF16)] uint16 *str; | 
|---|
| 993 | } drsuapi_DsNameString; | 
|---|
| 994 |  | 
|---|
| 995 | typedef struct { | 
|---|
| 996 | uint32 codepage; /* 0x000004e4 - 1252 is german codepage*/ | 
|---|
| 997 | uint32 language; /* 0x00000407 - german language ID*/ | 
|---|
| 998 | drsuapi_DsNameFlags format_flags; | 
|---|
| 999 | drsuapi_DsNameFormat format_offered; | 
|---|
| 1000 | drsuapi_DsNameFormat format_desired; | 
|---|
| 1001 | [range(1,10000)] uint32 count; | 
|---|
| 1002 | [size_is(count)] drsuapi_DsNameString *names; | 
|---|
| 1003 | } drsuapi_DsNameRequest1; | 
|---|
| 1004 |  | 
|---|
| 1005 | typedef [switch_type(uint32)] union { | 
|---|
| 1006 | [case(1)] drsuapi_DsNameRequest1 req1; | 
|---|
| 1007 | } drsuapi_DsNameRequest; | 
|---|
| 1008 |  | 
|---|
| 1009 | typedef struct { | 
|---|
| 1010 | drsuapi_DsNameStatus status; | 
|---|
| 1011 | [charset(UTF16),string] uint16 *dns_domain_name; | 
|---|
| 1012 | [charset(UTF16),string] uint16 *result_name; | 
|---|
| 1013 | } drsuapi_DsNameInfo1; | 
|---|
| 1014 |  | 
|---|
| 1015 | typedef struct { | 
|---|
| 1016 | uint32 count; | 
|---|
| 1017 | [size_is(count)] drsuapi_DsNameInfo1 *array; | 
|---|
| 1018 | } drsuapi_DsNameCtr1; | 
|---|
| 1019 |  | 
|---|
| 1020 | typedef [switch_type(uint32)] union { | 
|---|
| 1021 | [case(1)] drsuapi_DsNameCtr1 *ctr1; | 
|---|
| 1022 | } drsuapi_DsNameCtr; | 
|---|
| 1023 |  | 
|---|
| 1024 | WERROR drsuapi_DsCrackNames( | 
|---|
| 1025 | [in] policy_handle *bind_handle, | 
|---|
| 1026 | [in] uint32 level, | 
|---|
| 1027 | [in,ref,switch_is(level)] drsuapi_DsNameRequest *req, | 
|---|
| 1028 | [out,ref] uint32 *level_out, | 
|---|
| 1029 | [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr | 
|---|
| 1030 | ); | 
|---|
| 1031 |  | 
|---|
| 1032 | /*****************/ | 
|---|
| 1033 | /* Function 0x0d */ | 
|---|
| 1034 | typedef [v1_enum] enum { | 
|---|
| 1035 | DRSUAPI_DS_SPN_OPERATION_ADD    = 0, | 
|---|
| 1036 | DRSUAPI_DS_SPN_OPERATION_REPLACE= 1, | 
|---|
| 1037 | DRSUAPI_DS_SPN_OPERATION_DELETE = 2 | 
|---|
| 1038 | } drsuapi_DsSpnOperation; | 
|---|
| 1039 |  | 
|---|
| 1040 | typedef struct { | 
|---|
| 1041 | drsuapi_DsSpnOperation operation; | 
|---|
| 1042 | uint32 unknown1; | 
|---|
| 1043 | [charset(UTF16),string] uint16 *object_dn; | 
|---|
| 1044 | [range(0,10000)] uint32 count; | 
|---|
| 1045 | [size_is(count)] drsuapi_DsNameString *spn_names; | 
|---|
| 1046 | } drsuapi_DsWriteAccountSpnRequest1; | 
|---|
| 1047 |  | 
|---|
| 1048 | typedef [switch_type(uint32)] union { | 
|---|
| 1049 | [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1; | 
|---|
| 1050 | } drsuapi_DsWriteAccountSpnRequest; | 
|---|
| 1051 |  | 
|---|
| 1052 | typedef struct { | 
|---|
| 1053 | WERROR status; | 
|---|
| 1054 | } drsuapi_DsWriteAccountSpnResult1; | 
|---|
| 1055 |  | 
|---|
| 1056 | typedef [switch_type(uint32)] union { | 
|---|
| 1057 | [case(1)] drsuapi_DsWriteAccountSpnResult1 res1; | 
|---|
| 1058 | } drsuapi_DsWriteAccountSpnResult; | 
|---|
| 1059 |  | 
|---|
| 1060 | WERROR drsuapi_DsWriteAccountSpn( | 
|---|
| 1061 | [in] policy_handle *bind_handle, | 
|---|
| 1062 | [in] uint32 level, | 
|---|
| 1063 | [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req, | 
|---|
| 1064 | [out,ref] uint32 *level_out, | 
|---|
| 1065 | [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res | 
|---|
| 1066 | ); | 
|---|
| 1067 |  | 
|---|
| 1068 | /*****************/ | 
|---|
| 1069 | /* Function 0x0e */ | 
|---|
| 1070 | typedef struct { | 
|---|
| 1071 | [charset(UTF16),string] uint16 *server_dn; | 
|---|
| 1072 | [charset(UTF16),string] uint16 *domain_dn; | 
|---|
| 1073 | boolean32 commit; | 
|---|
| 1074 | } drsuapi_DsRemoveDSServerRequest1; | 
|---|
| 1075 |  | 
|---|
| 1076 | typedef [switch_type(uint32)] union { | 
|---|
| 1077 | [case(1)] drsuapi_DsRemoveDSServerRequest1 req1; | 
|---|
| 1078 | } drsuapi_DsRemoveDSServerRequest; | 
|---|
| 1079 |  | 
|---|
| 1080 | typedef struct { | 
|---|
| 1081 | boolean32 last_dc_in_domain; | 
|---|
| 1082 | } drsuapi_DsRemoveDSServerResult1; | 
|---|
| 1083 |  | 
|---|
| 1084 | typedef [switch_type(uint32)] union { | 
|---|
| 1085 | [case(1)] drsuapi_DsRemoveDSServerResult1 res1; | 
|---|
| 1086 | } drsuapi_DsRemoveDSServerResult; | 
|---|
| 1087 |  | 
|---|
| 1088 | WERROR drsuapi_DsRemoveDSServer( | 
|---|
| 1089 | [in] policy_handle *bind_handle, | 
|---|
| 1090 | [in] uint32 level, | 
|---|
| 1091 | [in,ref,switch_is(level)] drsuapi_DsRemoveDSServerRequest *req, | 
|---|
| 1092 | [out,ref] uint32 *level_out, | 
|---|
| 1093 | [out,ref,switch_is(*level_out)] drsuapi_DsRemoveDSServerResult *res | 
|---|
| 1094 | ); | 
|---|
| 1095 |  | 
|---|
| 1096 | /*****************/ | 
|---|
| 1097 | /* Function 0x0f */ | 
|---|
| 1098 | [todo] WERROR DRSUAPI_REMOVE_DS_DOMAIN(); | 
|---|
| 1099 |  | 
|---|
| 1100 | /*****************/ | 
|---|
| 1101 | /* Function 0x10 */ | 
|---|
| 1102 | typedef struct { | 
|---|
| 1103 | [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */ | 
|---|
| 1104 | int32 level; /* specifies the switch level for the request */ | 
|---|
| 1105 | } drsuapi_DsGetDCInfoRequest1; | 
|---|
| 1106 |  | 
|---|
| 1107 | typedef [switch_type(int32)] union { | 
|---|
| 1108 | [case(1)] drsuapi_DsGetDCInfoRequest1 req1; | 
|---|
| 1109 | } drsuapi_DsGetDCInfoRequest; | 
|---|
| 1110 |  | 
|---|
| 1111 | typedef struct { | 
|---|
| 1112 | [charset(UTF16),string] uint16 *netbios_name; | 
|---|
| 1113 | [charset(UTF16),string] uint16 *dns_name; | 
|---|
| 1114 | [charset(UTF16),string] uint16 *site_name; | 
|---|
| 1115 | [charset(UTF16),string] uint16 *computer_dn; | 
|---|
| 1116 | [charset(UTF16),string] uint16 *server_dn; | 
|---|
| 1117 | uint32 is_pdc; | 
|---|
| 1118 | uint32 is_enabled; | 
|---|
| 1119 | } drsuapi_DsGetDCInfo1; | 
|---|
| 1120 |  | 
|---|
| 1121 | typedef struct { | 
|---|
| 1122 | [range(0,10000)] uint32 count; | 
|---|
| 1123 | [size_is(count)] drsuapi_DsGetDCInfo1 *array; | 
|---|
| 1124 | } drsuapi_DsGetDCInfoCtr1; | 
|---|
| 1125 |  | 
|---|
| 1126 | typedef struct { | 
|---|
| 1127 | [charset(UTF16),string] uint16 *netbios_name; | 
|---|
| 1128 | [charset(UTF16),string] uint16 *dns_name; | 
|---|
| 1129 | [charset(UTF16),string] uint16 *site_name; | 
|---|
| 1130 | [charset(UTF16),string] uint16 *site_dn; | 
|---|
| 1131 | [charset(UTF16),string] uint16 *computer_dn; | 
|---|
| 1132 | [charset(UTF16),string] uint16 *server_dn; | 
|---|
| 1133 | [charset(UTF16),string] uint16 *ntds_dn; | 
|---|
| 1134 | uint32 is_pdc; | 
|---|
| 1135 | uint32 is_enabled; | 
|---|
| 1136 | uint32 is_gc; | 
|---|
| 1137 | GUID site_guid; | 
|---|
| 1138 | GUID computer_guid; | 
|---|
| 1139 | GUID server_guid; | 
|---|
| 1140 | GUID ntds_guid; | 
|---|
| 1141 | } drsuapi_DsGetDCInfo2; | 
|---|
| 1142 |  | 
|---|
| 1143 | typedef struct { | 
|---|
| 1144 | [range(0,10000)] uint32 count; | 
|---|
| 1145 | [size_is(count)] drsuapi_DsGetDCInfo2 *array; | 
|---|
| 1146 | } drsuapi_DsGetDCInfoCtr2; | 
|---|
| 1147 |  | 
|---|
| 1148 | typedef struct { | 
|---|
| 1149 | [charset(UTF16),string] uint16 *netbios_name; | 
|---|
| 1150 | [charset(UTF16),string] uint16 *dns_name; | 
|---|
| 1151 | [charset(UTF16),string] uint16 *site_name; | 
|---|
| 1152 | [charset(UTF16),string] uint16 *site_dn; | 
|---|
| 1153 | [charset(UTF16),string] uint16 *computer_dn; | 
|---|
| 1154 | [charset(UTF16),string] uint16 *server_dn; | 
|---|
| 1155 | [charset(UTF16),string] uint16 *ntds_dn; | 
|---|
| 1156 | uint32 is_pdc; | 
|---|
| 1157 | uint32 is_enabled; | 
|---|
| 1158 | uint32 is_gc; | 
|---|
| 1159 | uint32 is_rodc; | 
|---|
| 1160 | GUID site_guid; | 
|---|
| 1161 | GUID computer_guid; | 
|---|
| 1162 | GUID server_guid; | 
|---|
| 1163 | GUID ntds_guid; | 
|---|
| 1164 | } drsuapi_DsGetDCInfo3; | 
|---|
| 1165 |  | 
|---|
| 1166 | typedef struct { | 
|---|
| 1167 | [range(0,10000)] uint32 count; | 
|---|
| 1168 | [size_is(count)] drsuapi_DsGetDCInfo3 *array; | 
|---|
| 1169 | } drsuapi_DsGetDCInfoCtr3; | 
|---|
| 1170 |  | 
|---|
| 1171 | /* | 
|---|
| 1172 | * this represents an active connection to the | 
|---|
| 1173 | * Directory System Agent (DSA) | 
|---|
| 1174 | * this can be via LDAP or DRSUAPI | 
|---|
| 1175 | */ | 
|---|
| 1176 | typedef struct { | 
|---|
| 1177 | [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address; | 
|---|
| 1178 | uint32 unknown2; | 
|---|
| 1179 | uint32 connection_time; /* in seconds */ | 
|---|
| 1180 | uint32 unknown4; | 
|---|
| 1181 | uint32 unknown5; | 
|---|
| 1182 | uint32 unknown6; | 
|---|
| 1183 | /* | 
|---|
| 1184 | * client_account can be the following: | 
|---|
| 1185 | * "W2K3\Administrator" | 
|---|
| 1186 | * "Administrator@W2K3" | 
|---|
| 1187 | * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base" | 
|---|
| 1188 | * "" | 
|---|
| 1189 | * or NULL | 
|---|
| 1190 | */ | 
|---|
| 1191 | [charset(UTF16),string] uint16 *client_account; | 
|---|
| 1192 | } drsuapi_DsGetDCConnection01; | 
|---|
| 1193 |  | 
|---|
| 1194 | typedef struct { | 
|---|
| 1195 | [range(0,10000)] uint32 count; | 
|---|
| 1196 | [size_is(count)] drsuapi_DsGetDCConnection01 *array; | 
|---|
| 1197 | } drsuapi_DsGetDCConnectionCtr01; | 
|---|
| 1198 |  | 
|---|
| 1199 | typedef [v1_enum] enum { | 
|---|
| 1200 | DRSUAPI_DC_INFO_CTR_1  = 1, | 
|---|
| 1201 | DRSUAPI_DC_INFO_CTR_2  = 2, | 
|---|
| 1202 | DRSUAPI_DC_INFO_CTR_3  = 3, | 
|---|
| 1203 | DRSUAPI_DC_CONNECTION_CTR_01 = -1 | 
|---|
| 1204 | } drsuapi_DsGetDCInfoCtrLevels; | 
|---|
| 1205 |  | 
|---|
| 1206 | typedef [switch_type(int32)] union { | 
|---|
| 1207 | [case(DRSUAPI_DC_INFO_CTR_1)]  drsuapi_DsGetDCInfoCtr1  ctr1; | 
|---|
| 1208 | [case(DRSUAPI_DC_INFO_CTR_2)]  drsuapi_DsGetDCInfoCtr2  ctr2; | 
|---|
| 1209 | [case(DRSUAPI_DC_INFO_CTR_3)]  drsuapi_DsGetDCInfoCtr3  ctr3; | 
|---|
| 1210 | [case(DRSUAPI_DC_CONNECTION_CTR_01)] drsuapi_DsGetDCConnectionCtr01 ctr01; | 
|---|
| 1211 | } drsuapi_DsGetDCInfoCtr; | 
|---|
| 1212 |  | 
|---|
| 1213 | WERROR drsuapi_DsGetDomainControllerInfo( | 
|---|
| 1214 | [in] policy_handle *bind_handle, | 
|---|
| 1215 | [in] int32 level, | 
|---|
| 1216 | [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req, | 
|---|
| 1217 | [out,ref] int32 *level_out, | 
|---|
| 1218 | [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr | 
|---|
| 1219 | ); | 
|---|
| 1220 |  | 
|---|
| 1221 | /*****************/ | 
|---|
| 1222 | /* Function 0x11 */ | 
|---|
| 1223 | typedef [public,noprint] struct { | 
|---|
| 1224 | drsuapi_DsReplicaObjectListItem *next_object; | 
|---|
| 1225 | drsuapi_DsReplicaObject object; | 
|---|
| 1226 | } drsuapi_DsReplicaObjectListItem; | 
|---|
| 1227 |  | 
|---|
| 1228 | /* | 
|---|
| 1229 | * The DsAddEntry() call which creates a nTDSDSA object, | 
|---|
| 1230 | * also adds a servicePrincipalName in the following form | 
|---|
| 1231 | * to the computer account of the new domain controller | 
|---|
| 1232 | * referenced by the "serverReferenece" attribute. | 
|---|
| 1233 | * | 
|---|
| 1234 | * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name> | 
|---|
| 1235 | * | 
|---|
| 1236 | * also note that the "serverReference" isn't added to the new object! | 
|---|
| 1237 | */ | 
|---|
| 1238 | const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID = "E3514235-4B06-11D1-AB04-00C04FC2DCD2"; | 
|---|
| 1239 |  | 
|---|
| 1240 | /* Error codes to classify an error that occurs | 
|---|
| 1241 | * during a search for, or the update of, | 
|---|
| 1242 | * a directory object */ | 
|---|
| 1243 | typedef [v1_enum] enum { | 
|---|
| 1244 | DRSUAPI_DIRERR_OK         = 0, | 
|---|
| 1245 | DRSUAPI_DIRERR_ATTRIBUTE  = 1, | 
|---|
| 1246 | DRSUAPI_DIRERR_NAME       = 2, | 
|---|
| 1247 | DRSUAPI_DIRERR_REFERRAL   = 3, | 
|---|
| 1248 | DRSUAPI_DIRERR_SECURITY   = 4, | 
|---|
| 1249 | DRSUAPI_DIRERR_SERVICE    = 5, | 
|---|
| 1250 | DRSUAPI_DIRERR_UPDATE     = 6, | 
|---|
| 1251 | DRSUAPI_DIRERR_SYSTEM     = 7 | 
|---|
| 1252 | } drsuapi_DsAddEntry_DirErr; | 
|---|
| 1253 |  | 
|---|
| 1254 | /* | 
|---|
| 1255 | * Ref: DRS_MSG_ADDENTRYREQ_V2, [MS-DRSR]: 4.1.1.1.3 | 
|---|
| 1256 | */ | 
|---|
| 1257 | typedef struct { | 
|---|
| 1258 | drsuapi_DsReplicaObjectListItem first_object; | 
|---|
| 1259 | } drsuapi_DsAddEntryRequest2; | 
|---|
| 1260 |  | 
|---|
| 1261 | /* Buffer type is actually more | 
|---|
| 1262 | * like a semi Flags | 
|---|
| 1263 | * Ref: DRS_SecBuffer, [MS-DRSR]: 5.41 */ | 
|---|
| 1264 | typedef [v1_enum,noprint] enum { | 
|---|
| 1265 | DRSUAPI_SECBUFFER_EMPTY          = 0x00000000, | 
|---|
| 1266 | DRSUAPI_SECBUFFER_DATA           = 0x00000001, | 
|---|
| 1267 | DRSUAPI_SECBUFFER_TOKEN          = 0x00000002, | 
|---|
| 1268 | DRSUAPI_SECBUFFER_PKG_PARAMS     = 0x00000003, | 
|---|
| 1269 | DRSUAPI_SECBUFFER_MISSING        = 0x00000004, | 
|---|
| 1270 | DRSUAPI_SECBUFFER_EXTRA          = 0x00000005, | 
|---|
| 1271 | DRSUAPI_SECBUFFER_STREAM_TRAILER = 0x00000006, | 
|---|
| 1272 | DRSUAPI_SECBUFFER_STREAM_HEADER  = 0x00000007, | 
|---|
| 1273 | DRSUAPI_SECBUFFER_READONLY       = 0x80000000 | 
|---|
| 1274 | } drsuapi_SecBufferType; | 
|---|
| 1275 |  | 
|---|
| 1276 | typedef struct { | 
|---|
| 1277 | [range(0,10000)] uint32 buf_size; | 
|---|
| 1278 | drsuapi_SecBufferType buf_type; | 
|---|
| 1279 | [size_is(buf_size)] uint8 *buffer; | 
|---|
| 1280 | } drsuapi_SecBuffer; | 
|---|
| 1281 |  | 
|---|
| 1282 | typedef struct { | 
|---|
| 1283 | [value(0)] uint32 version; | 
|---|
| 1284 | [range(0,10000)] uint32 buff_count; | 
|---|
| 1285 | [size_is(buff_count)] drsuapi_SecBuffer *buffers; | 
|---|
| 1286 | } drsuapi_SecBufferDesc; | 
|---|
| 1287 |  | 
|---|
| 1288 | /* | 
|---|
| 1289 | * Ref: DRS_MSG_ADDENTRYREQ_V3, [MS-DRSR]: 4.1.1.1.4 | 
|---|
| 1290 | */ | 
|---|
| 1291 | typedef struct { | 
|---|
| 1292 | drsuapi_DsReplicaObjectListItem first_object; | 
|---|
| 1293 | drsuapi_SecBufferDesc *client_creds; | 
|---|
| 1294 | } drsuapi_DsAddEntryRequest3; | 
|---|
| 1295 |  | 
|---|
| 1296 | typedef [switch_type(uint32)] union { | 
|---|
| 1297 | [case(2)] drsuapi_DsAddEntryRequest2 req2; | 
|---|
| 1298 | [case(3)] drsuapi_DsAddEntryRequest3 req3; | 
|---|
| 1299 | } drsuapi_DsAddEntryRequest; | 
|---|
| 1300 |  | 
|---|
| 1301 | /* Generic extended error info | 
|---|
| 1302 | * commonly used in most places | 
|---|
| 1303 | * where rich error info is returned */ | 
|---|
| 1304 | typedef struct { | 
|---|
| 1305 | uint32  dsid;           /* implementation-specific diagnostic code */ | 
|---|
| 1306 | WERROR  extended_err;   /* 0, STATUS code, or Windows error code */ | 
|---|
| 1307 | uint32  extended_data;  /* implementation-specific diagnostic code */ | 
|---|
| 1308 | uint16  problem;        /* 0 or PROBLEM error code */ | 
|---|
| 1309 | } drsuapi_DsAddEntryErrorInfoX; | 
|---|
| 1310 |  | 
|---|
| 1311 | /* Attribute errors | 
|---|
| 1312 | * Ref: ATRERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.11 */ | 
|---|
| 1313 | typedef struct { | 
|---|
| 1314 | uint32  dsid; | 
|---|
| 1315 | WERROR  extended_err; | 
|---|
| 1316 | uint32  extended_data; | 
|---|
| 1317 | uint16  problem; | 
|---|
| 1318 | drsuapi_DsAttributeId attid; | 
|---|
| 1319 | boolean32 is_val_returned; | 
|---|
| 1320 | drsuapi_DsAttributeValue attr_val; | 
|---|
| 1321 | } drsuapi_DsAddEntry_AttrErr_V1; | 
|---|
| 1322 |  | 
|---|
| 1323 | typedef [noprint] struct { | 
|---|
| 1324 | drsuapi_DsAddEntry_AttrErrListItem_V1 *next; | 
|---|
| 1325 | drsuapi_DsAddEntry_AttrErr_V1 err_data; | 
|---|
| 1326 | } drsuapi_DsAddEntry_AttrErrListItem_V1; | 
|---|
| 1327 |  | 
|---|
| 1328 | typedef struct { | 
|---|
| 1329 | drsuapi_DsReplicaObjectIdentifier *id; | 
|---|
| 1330 | uint32 count; | 
|---|
| 1331 | drsuapi_DsAddEntry_AttrErrListItem_V1 first; | 
|---|
| 1332 | } drsuapi_DsAddEntryErrorInfo_Attr_V1; | 
|---|
| 1333 |  | 
|---|
| 1334 | /* Name resolution error | 
|---|
| 1335 | * Ref: NAMERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.14 */ | 
|---|
| 1336 | typedef struct { | 
|---|
| 1337 | uint32  dsid; | 
|---|
| 1338 | WERROR  extended_err; | 
|---|
| 1339 | uint32  extended_data; | 
|---|
| 1340 | uint16  problem; | 
|---|
| 1341 | drsuapi_DsReplicaObjectIdentifier *id_matched; /* The best match for the supplied object identity */ | 
|---|
| 1342 | } drsuapi_DsAddEntryErrorInfo_Name_V1; | 
|---|
| 1343 |  | 
|---|
| 1344 | /* Referral error | 
|---|
| 1345 | * Ref: REFERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.15 */ | 
|---|
| 1346 | typedef struct { | 
|---|
| 1347 | [value(83)] uint8  name_res;    /* Must be 'S' */ | 
|---|
| 1348 | [value(0)]  uint8  unused_pad; | 
|---|
| 1349 | [value(0)]  uint16 next_rdn; | 
|---|
| 1350 | } drsuapi_NameResOp_V1; | 
|---|
| 1351 |  | 
|---|
| 1352 | typedef [enum16bit] enum { | 
|---|
| 1353 | DRSUAPI_CH_REFTYPE_SUPERIOR     = 0x0000, /* referral to a superior DC */ | 
|---|
| 1354 | DRSUAPI_CH_REFTYPE_SUBORDINATE  = 0x0001, /* referral to a subordinate DC */ | 
|---|
| 1355 | DRSUAPI_CH_REFTYPE_NSSR         = 0x0002, /* Not used */ | 
|---|
| 1356 | DRSUAPI_CH_REFTYPE_CROSS        = 0x0003  /* A referral to an external crossRef object */ | 
|---|
| 1357 | } drsuapi_DsAddEntry_RefType; | 
|---|
| 1358 |  | 
|---|
| 1359 | typedef [enum8bit] enum { | 
|---|
| 1360 | DRSUAPI_SE_CHOICE_BASE_ONLY     = 0x00, | 
|---|
| 1361 | DRSUAPI_SE_CHOICE_IMMED_CHLDRN  = 0x01, | 
|---|
| 1362 | DRSUAPI_SE_CHOICE_WHOLE_SUBTREE = 0x02 | 
|---|
| 1363 | } drsuapi_DsAddEntry_ChoiceType; | 
|---|
| 1364 |  | 
|---|
| 1365 | /* list of network names of the DCs | 
|---|
| 1366 | * to which the referral is directed */ | 
|---|
| 1367 | typedef struct  { | 
|---|
| 1368 | drsuapi_DsaAddressListItem_V1 *next; | 
|---|
| 1369 | lsa_String *address; | 
|---|
| 1370 | } drsuapi_DsaAddressListItem_V1; | 
|---|
| 1371 |  | 
|---|
| 1372 | typedef struct { | 
|---|
| 1373 | drsuapi_DsReplicaObjectIdentifier *id_target; /* object to which the referral is directed */ | 
|---|
| 1374 | drsuapi_NameResOp_V1 op_state; | 
|---|
| 1375 | [value(0)] uint16 rdn_alias; | 
|---|
| 1376 | [value(0)] uint16 rdn_internal; | 
|---|
| 1377 | drsuapi_DsAddEntry_RefType ref_type; | 
|---|
| 1378 | uint16 addr_list_count; | 
|---|
| 1379 | drsuapi_DsaAddressListItem_V1 *addr_list; | 
|---|
| 1380 | drsuapi_DsAddEntry_RefErrListItem_V1 *next; | 
|---|
| 1381 | boolean32 is_choice_set; | 
|---|
| 1382 | drsuapi_DsAddEntry_ChoiceType choice; | 
|---|
| 1383 | } drsuapi_DsAddEntry_RefErrListItem_V1; | 
|---|
| 1384 |  | 
|---|
| 1385 | typedef struct { | 
|---|
| 1386 | uint32  dsid; | 
|---|
| 1387 | WERROR  extended_err; | 
|---|
| 1388 | uint32  extended_data; | 
|---|
| 1389 | drsuapi_DsAddEntry_RefErrListItem_V1 refer; | 
|---|
| 1390 | } drsuapi_DsAddEntryErrorInfo_Referr_V1; | 
|---|
| 1391 |  | 
|---|
| 1392 | typedef [switch_type(uint32)] union { | 
|---|
| 1393 | [case(1)] drsuapi_DsAddEntryErrorInfo_Attr_V1   attr_err; | 
|---|
| 1394 | [case(2)] drsuapi_DsAddEntryErrorInfo_Name_V1   name_err; | 
|---|
| 1395 | [case(3)] drsuapi_DsAddEntryErrorInfo_Referr_V1 referral_err; | 
|---|
| 1396 | [case(4)] drsuapi_DsAddEntryErrorInfoX          security_err; | 
|---|
| 1397 | [case(5)] drsuapi_DsAddEntryErrorInfoX          service_err; | 
|---|
| 1398 | [case(6)] drsuapi_DsAddEntryErrorInfoX          update_err; | 
|---|
| 1399 | [case(7)] drsuapi_DsAddEntryErrorInfoX          system_err; | 
|---|
| 1400 | } drsuapi_DsAddEntryErrorInfo; | 
|---|
| 1401 |  | 
|---|
| 1402 | typedef struct { | 
|---|
| 1403 | WERROR status; | 
|---|
| 1404 | drsuapi_DsAddEntry_DirErr dir_err; | 
|---|
| 1405 | [switch_is(dir_err)] drsuapi_DsAddEntryErrorInfo *info; | 
|---|
| 1406 | } drsuapi_DsAddEntry_ErrData_V1; | 
|---|
| 1407 |  | 
|---|
| 1408 | typedef [switch_type(uint32)] union { | 
|---|
| 1409 | [case(1)] drsuapi_DsAddEntry_ErrData_V1 v1; | 
|---|
| 1410 | } drsuapi_DsAddEntry_ErrData; | 
|---|
| 1411 |  | 
|---|
| 1412 | typedef struct { | 
|---|
| 1413 | GUID guid; | 
|---|
| 1414 | dom_sid28 sid; | 
|---|
| 1415 | } drsuapi_DsReplicaObjectIdentifier2; | 
|---|
| 1416 |  | 
|---|
| 1417 | typedef struct { | 
|---|
| 1418 | drsuapi_DsReplicaObjectIdentifier *id; | 
|---|
| 1419 | drsuapi_DsAddEntry_DirErr dir_err; | 
|---|
| 1420 | uint32                    dsid;          /* implementation-specific diagnostic code */ | 
|---|
| 1421 | WERROR                    extended_err;  /* 0, STATUS code, or Windows error code */ | 
|---|
| 1422 | uint32                    extended_data; /* implementation-specific diagnostic code */ | 
|---|
| 1423 | uint16                    problem;       /* 0 or PROBLEM error code */ | 
|---|
| 1424 | [range(0,10000)] uint32 count; | 
|---|
| 1425 | [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects; | 
|---|
| 1426 | } drsuapi_DsAddEntryCtr2; | 
|---|
| 1427 |  | 
|---|
| 1428 | typedef struct { | 
|---|
| 1429 | drsuapi_DsReplicaObjectIdentifier *id; | 
|---|
| 1430 | uint32 err_ver; /* Must be 1 */ | 
|---|
| 1431 | [switch_is(err_ver)] drsuapi_DsAddEntry_ErrData *err_data; | 
|---|
| 1432 | [range(0,10000)] uint32 count; | 
|---|
| 1433 | [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects; | 
|---|
| 1434 | } drsuapi_DsAddEntryCtr3; | 
|---|
| 1435 |  | 
|---|
| 1436 | typedef [switch_type(uint32)] union { | 
|---|
| 1437 | [case(2)] drsuapi_DsAddEntryCtr2 ctr2; | 
|---|
| 1438 | [case(3)] drsuapi_DsAddEntryCtr3 ctr3; | 
|---|
| 1439 | } drsuapi_DsAddEntryCtr; | 
|---|
| 1440 |  | 
|---|
| 1441 | [public] WERROR drsuapi_DsAddEntry( | 
|---|
| 1442 | [in] policy_handle *bind_handle, | 
|---|
| 1443 | [in] uint32 level, | 
|---|
| 1444 | [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req, | 
|---|
| 1445 | [out,ref] uint32 *level_out, | 
|---|
| 1446 | [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr | 
|---|
| 1447 | ); | 
|---|
| 1448 |  | 
|---|
| 1449 | /*****************/ | 
|---|
| 1450 | /* Function 0x12 */ | 
|---|
| 1451 | typedef bitmap { | 
|---|
| 1452 | DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION   = 0x00000001, | 
|---|
| 1453 | DRSUAPI_DS_EXECUTE_KCC_DAMPED                   = 0x00000002 | 
|---|
| 1454 | } drsuapi_DsExecuteKCCFlags; | 
|---|
| 1455 |  | 
|---|
| 1456 | typedef struct { | 
|---|
| 1457 | uint32 taskID; | 
|---|
| 1458 | drsuapi_DsExecuteKCCFlags flags; | 
|---|
| 1459 | } drsuapi_DsExecuteKCC1; | 
|---|
| 1460 |  | 
|---|
| 1461 | typedef [switch_type(uint32)] union { | 
|---|
| 1462 | [case(1)] drsuapi_DsExecuteKCC1 ctr1; | 
|---|
| 1463 | } drsuapi_DsExecuteKCCRequest; | 
|---|
| 1464 |  | 
|---|
| 1465 | WERROR drsuapi_DsExecuteKCC( | 
|---|
| 1466 | [in] policy_handle *bind_handle, | 
|---|
| 1467 | [in] uint32 level, | 
|---|
| 1468 | [in, ref, switch_is(level)] drsuapi_DsExecuteKCCRequest *req | 
|---|
| 1469 | ); | 
|---|
| 1470 |  | 
|---|
| 1471 | /*****************/ | 
|---|
| 1472 | /* Function 0x13 */ | 
|---|
| 1473 | typedef [v1_enum] enum { | 
|---|
| 1474 | DRSUAPI_DS_REPLICA_GET_INFO                             = 1, | 
|---|
| 1475 | DRSUAPI_DS_REPLICA_GET_INFO2                            = 2 | 
|---|
| 1476 | } drsuapi_DsReplicaGetInfoLevel; | 
|---|
| 1477 |  | 
|---|
| 1478 | typedef [v1_enum] enum { | 
|---|
| 1479 | DRSUAPI_DS_REPLICA_INFO_NEIGHBORS                       = 0, | 
|---|
| 1480 | DRSUAPI_DS_REPLICA_INFO_CURSORS                         = 1, | 
|---|
| 1481 | DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA                    = 2, | 
|---|
| 1482 | DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES        = 3, | 
|---|
| 1483 | DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES           = 4, | 
|---|
| 1484 | DRSUAPI_DS_REPLICA_INFO_PENDING_OPS                     = 5, | 
|---|
| 1485 | DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA        = 6, | 
|---|
| 1486 | DRSUAPI_DS_REPLICA_INFO_CURSORS2                        = 7, | 
|---|
| 1487 | DRSUAPI_DS_REPLICA_INFO_CURSORS3                        = 8, | 
|---|
| 1488 | DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2                   = 9, | 
|---|
| 1489 | DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2       = 10, | 
|---|
| 1490 | DRSUAPI_DS_REPLICA_INFO_REPSTO                          = -2, | 
|---|
| 1491 | DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS                 = -4, | 
|---|
| 1492 | DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1              = -5, | 
|---|
| 1493 | DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS           = -6 | 
|---|
| 1494 | } drsuapi_DsReplicaInfoType; | 
|---|
| 1495 |  | 
|---|
| 1496 | typedef struct { | 
|---|
| 1497 | drsuapi_DsReplicaInfoType info_type; | 
|---|
| 1498 | [charset(UTF16),string] uint16 *object_dn; | 
|---|
| 1499 | GUID source_dsa_guid; | 
|---|
| 1500 | } drsuapi_DsReplicaGetInfoRequest1; | 
|---|
| 1501 |  | 
|---|
| 1502 | typedef struct { | 
|---|
| 1503 | drsuapi_DsReplicaInfoType info_type; | 
|---|
| 1504 | [charset(UTF16),string] uint16 *object_dn; | 
|---|
| 1505 | GUID source_dsa_guid; | 
|---|
| 1506 | uint32 flags; | 
|---|
| 1507 | [charset(UTF16),string] uint16 *attribute_name; | 
|---|
| 1508 | [charset(UTF16),string] uint16 *value_dn_str; | 
|---|
| 1509 | uint32 enumeration_context; | 
|---|
| 1510 | } drsuapi_DsReplicaGetInfoRequest2; | 
|---|
| 1511 |  | 
|---|
| 1512 | typedef [switch_type(drsuapi_DsReplicaGetInfoLevel)] union { | 
|---|
| 1513 | [case(DRSUAPI_DS_REPLICA_GET_INFO)] drsuapi_DsReplicaGetInfoRequest1 req1; | 
|---|
| 1514 | [case(DRSUAPI_DS_REPLICA_GET_INFO2)] drsuapi_DsReplicaGetInfoRequest2 req2; | 
|---|
| 1515 | } drsuapi_DsReplicaGetInfoRequest; | 
|---|
| 1516 |  | 
|---|
| 1517 | typedef struct { | 
|---|
| 1518 | [charset(UTF16),string] uint16 *naming_context_dn; | 
|---|
| 1519 | [charset(UTF16),string] uint16 *source_dsa_obj_dn; | 
|---|
| 1520 | [charset(UTF16),string] uint16 *source_dsa_address; | 
|---|
| 1521 | [charset(UTF16),string] uint16 *transport_obj_dn; | 
|---|
| 1522 | drsuapi_DrsOptions replica_flags; | 
|---|
| 1523 | uint32 reserved; | 
|---|
| 1524 | GUID naming_context_obj_guid; | 
|---|
| 1525 | GUID source_dsa_obj_guid; | 
|---|
| 1526 | GUID source_dsa_invocation_id; | 
|---|
| 1527 | GUID transport_obj_guid; | 
|---|
| 1528 | hyper tmp_highest_usn; | 
|---|
| 1529 | hyper highest_usn; | 
|---|
| 1530 | NTTIME last_success; | 
|---|
| 1531 | NTTIME last_attempt; | 
|---|
| 1532 | WERROR result_last_attempt; | 
|---|
| 1533 | uint32 consecutive_sync_failures; | 
|---|
| 1534 | } drsuapi_DsReplicaNeighbour; | 
|---|
| 1535 |  | 
|---|
| 1536 | typedef struct { | 
|---|
| 1537 | uint32 count; | 
|---|
| 1538 | uint32 reserved; | 
|---|
| 1539 | [size_is(count)] drsuapi_DsReplicaNeighbour array[]; | 
|---|
| 1540 | } drsuapi_DsReplicaNeighbourCtr; | 
|---|
| 1541 |  | 
|---|
| 1542 | typedef struct { | 
|---|
| 1543 | uint32 count; | 
|---|
| 1544 | uint32 reserved; | 
|---|
| 1545 | [size_is(count)] drsuapi_DsReplicaCursor array[]; | 
|---|
| 1546 | } drsuapi_DsReplicaCursorCtr; | 
|---|
| 1547 |  | 
|---|
| 1548 | typedef struct { | 
|---|
| 1549 | [charset(UTF16),string] uint16 *attribute_name; | 
|---|
| 1550 | uint32 version; | 
|---|
| 1551 | NTTIME originating_change_time; | 
|---|
| 1552 | GUID originating_invocation_id; | 
|---|
| 1553 | hyper originating_usn; | 
|---|
| 1554 | hyper local_usn; | 
|---|
| 1555 | } drsuapi_DsReplicaObjMetaData; | 
|---|
| 1556 |  | 
|---|
| 1557 | typedef struct { | 
|---|
| 1558 | uint32 count; | 
|---|
| 1559 | uint32 reserved; | 
|---|
| 1560 | [size_is(count)] drsuapi_DsReplicaObjMetaData array[]; | 
|---|
| 1561 | } drsuapi_DsReplicaObjMetaDataCtr; | 
|---|
| 1562 |  | 
|---|
| 1563 | typedef struct { | 
|---|
| 1564 | [charset(UTF16),string] uint16 *dsa_obj_dn; | 
|---|
| 1565 | GUID dsa_obj_guid; | 
|---|
| 1566 | NTTIME first_failure; | 
|---|
| 1567 | uint32 num_failures; | 
|---|
| 1568 | WERROR last_result; | 
|---|
| 1569 | } drsuapi_DsReplicaKccDsaFailure; | 
|---|
| 1570 |  | 
|---|
| 1571 | typedef struct { | 
|---|
| 1572 | uint32 count; | 
|---|
| 1573 | uint32 reserved; | 
|---|
| 1574 | [size_is(count)] drsuapi_DsReplicaKccDsaFailure array[]; | 
|---|
| 1575 | } drsuapi_DsReplicaKccDsaFailuresCtr; | 
|---|
| 1576 |  | 
|---|
| 1577 | typedef enum { | 
|---|
| 1578 | DRSUAPI_DS_REPLICA_OP_TYPE_SYNC         = 0, | 
|---|
| 1579 | DRSUAPI_DS_REPLICA_OP_TYPE_ADD          = 1, | 
|---|
| 1580 | DRSUAPI_DS_REPLICA_OP_TYPE_DELETE       = 2, | 
|---|
| 1581 | DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY       = 3, | 
|---|
| 1582 | DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS  = 4 | 
|---|
| 1583 | } drsuapi_DsReplicaOpType; | 
|---|
| 1584 |  | 
|---|
| 1585 | typedef struct { | 
|---|
| 1586 | NTTIME operation_start; | 
|---|
| 1587 | uint32 serial_num; /* unique till reboot */ | 
|---|
| 1588 | uint32 priority; | 
|---|
| 1589 | drsuapi_DsReplicaOpType operation_type; | 
|---|
| 1590 | drsuapi_DrsOptions options; | 
|---|
| 1591 | [charset(UTF16),string] uint16 *nc_dn; | 
|---|
| 1592 | [charset(UTF16),string] uint16 *remote_dsa_obj_dn; | 
|---|
| 1593 | [charset(UTF16),string] uint16 *remote_dsa_address; | 
|---|
| 1594 | GUID nc_obj_guid; | 
|---|
| 1595 | GUID remote_dsa_obj_guid; | 
|---|
| 1596 | } drsuapi_DsReplicaOp; | 
|---|
| 1597 |  | 
|---|
| 1598 | typedef struct { | 
|---|
| 1599 | NTTIME time; | 
|---|
| 1600 | uint32 count; | 
|---|
| 1601 | [size_is(count)] drsuapi_DsReplicaOp array[]; | 
|---|
| 1602 | } drsuapi_DsReplicaOpCtr; | 
|---|
| 1603 |  | 
|---|
| 1604 | typedef struct { | 
|---|
| 1605 | [charset(UTF16),string] uint16 *attribute_name; | 
|---|
| 1606 | [charset(UTF16),string] uint16 *object_dn; | 
|---|
| 1607 | [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary; | 
|---|
| 1608 | DATA_BLOB *binary; | 
|---|
| 1609 | NTTIME deleted; | 
|---|
| 1610 | NTTIME created; | 
|---|
| 1611 | uint32 version; | 
|---|
| 1612 | NTTIME originating_change_time; | 
|---|
| 1613 | GUID originating_invocation_id; | 
|---|
| 1614 | hyper originating_usn; | 
|---|
| 1615 | hyper local_usn; | 
|---|
| 1616 | } drsuapi_DsReplicaAttrValMetaData; | 
|---|
| 1617 |  | 
|---|
| 1618 | typedef struct { | 
|---|
| 1619 | uint32 count; | 
|---|
| 1620 | uint32 enumeration_context; | 
|---|
| 1621 | [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[]; | 
|---|
| 1622 | } drsuapi_DsReplicaAttrValMetaDataCtr; | 
|---|
| 1623 |  | 
|---|
| 1624 | typedef struct { | 
|---|
| 1625 | uint32 count; | 
|---|
| 1626 | uint32 enumeration_context; | 
|---|
| 1627 | [size_is(count)] drsuapi_DsReplicaCursor2 array[]; | 
|---|
| 1628 | } drsuapi_DsReplicaCursor2Ctr; | 
|---|
| 1629 |  | 
|---|
| 1630 | typedef struct { | 
|---|
| 1631 | GUID source_dsa_invocation_id; | 
|---|
| 1632 | hyper highest_usn; | 
|---|
| 1633 | NTTIME last_sync_success; | 
|---|
| 1634 | [charset(UTF16),string] uint16 *source_dsa_obj_dn; | 
|---|
| 1635 | } drsuapi_DsReplicaCursor3; | 
|---|
| 1636 |  | 
|---|
| 1637 | typedef struct { | 
|---|
| 1638 | uint32 count; | 
|---|
| 1639 | uint32 enumeration_context; | 
|---|
| 1640 | [size_is(count)] drsuapi_DsReplicaCursor3 array[]; | 
|---|
| 1641 | } drsuapi_DsReplicaCursor3Ctr; | 
|---|
| 1642 |  | 
|---|
| 1643 | typedef struct { | 
|---|
| 1644 | [charset(UTF16),string] uint16 *attribute_name; | 
|---|
| 1645 | uint32 version; | 
|---|
| 1646 | NTTIME originating_change_time; | 
|---|
| 1647 | GUID originating_invocation_id; | 
|---|
| 1648 | hyper originating_usn; | 
|---|
| 1649 | hyper local_usn; | 
|---|
| 1650 | [charset(UTF16),string] uint16 *originating_dsa_dn; | 
|---|
| 1651 | } drsuapi_DsReplicaObjMetaData2; | 
|---|
| 1652 |  | 
|---|
| 1653 | typedef struct { | 
|---|
| 1654 | uint32 count; | 
|---|
| 1655 | uint32 enumeration_context; | 
|---|
| 1656 | [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[]; | 
|---|
| 1657 | } drsuapi_DsReplicaObjMetaData2Ctr; | 
|---|
| 1658 |  | 
|---|
| 1659 | typedef struct { | 
|---|
| 1660 | [charset(UTF16),string] uint16 *attribute_name; | 
|---|
| 1661 | [charset(UTF16),string] uint16 *object_dn; | 
|---|
| 1662 | [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary; | 
|---|
| 1663 | DATA_BLOB *binary; | 
|---|
| 1664 | NTTIME deleted; | 
|---|
| 1665 | NTTIME created; | 
|---|
| 1666 | uint32 version; | 
|---|
| 1667 | NTTIME originating_change_time; | 
|---|
| 1668 | GUID originating_invocation_id; | 
|---|
| 1669 | hyper originating_usn; | 
|---|
| 1670 | hyper local_usn; | 
|---|
| 1671 | [charset(UTF16),string] uint16 *originating_dsa_dn; | 
|---|
| 1672 | } drsuapi_DsReplicaAttrValMetaData2; | 
|---|
| 1673 |  | 
|---|
| 1674 | typedef struct { | 
|---|
| 1675 | uint32 count; | 
|---|
| 1676 | uint32 enumeration_context; | 
|---|
| 1677 | [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[]; | 
|---|
| 1678 | } drsuapi_DsReplicaAttrValMetaData2Ctr; | 
|---|
| 1679 |  | 
|---|
| 1680 | typedef struct { | 
|---|
| 1681 | hyper u1; /* session number? */ | 
|---|
| 1682 | uint32 u2; | 
|---|
| 1683 | uint32 u3; | 
|---|
| 1684 | GUID bind_guid; | 
|---|
| 1685 | NTTIME_1sec bind_time; | 
|---|
| 1686 | [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address; | 
|---|
| 1687 | uint32 u5; /* this is the same value the client used as pid in the DsBindInfoX struct */ | 
|---|
| 1688 | } drsuapi_DsReplicaConnection04; | 
|---|
| 1689 |  | 
|---|
| 1690 | typedef struct { | 
|---|
| 1691 | [range(0,10000)] uint32 count; | 
|---|
| 1692 | uint32 reserved; | 
|---|
| 1693 | [size_is(count)] drsuapi_DsReplicaConnection04 array[]; | 
|---|
| 1694 | } drsuapi_DsReplicaConnection04Ctr; | 
|---|
| 1695 |  | 
|---|
| 1696 | typedef struct { | 
|---|
| 1697 | [charset(UTF16),string] uint16 *str1; | 
|---|
| 1698 | uint32 u1; | 
|---|
| 1699 | uint32 u2; | 
|---|
| 1700 | uint32 u3; | 
|---|
| 1701 | uint32 u4; | 
|---|
| 1702 | uint32 u5; | 
|---|
| 1703 | hyper u6; | 
|---|
| 1704 | uint32 u7; | 
|---|
| 1705 | } drsuapi_DsReplica06; | 
|---|
| 1706 |  | 
|---|
| 1707 | typedef struct { | 
|---|
| 1708 | [range(0,256)] uint32 count; | 
|---|
| 1709 | uint32 reserved; | 
|---|
| 1710 | [size_is(count)] drsuapi_DsReplica06 array[]; | 
|---|
| 1711 | } drsuapi_DsReplica06Ctr; | 
|---|
| 1712 |  | 
|---|
| 1713 | typedef [switch_type(drsuapi_DsReplicaInfoType)] union { | 
|---|
| 1714 | [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] drsuapi_DsReplicaNeighbourCtr *neighbours; | 
|---|
| 1715 | [case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] drsuapi_DsReplicaCursorCtr *cursors; | 
|---|
| 1716 | [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] drsuapi_DsReplicaObjMetaDataCtr *objmetadata; | 
|---|
| 1717 | [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures; | 
|---|
| 1718 | [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures; | 
|---|
| 1719 | [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] drsuapi_DsReplicaOpCtr *pendingops; | 
|---|
| 1720 | [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata; | 
|---|
| 1721 | [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] drsuapi_DsReplicaCursor2Ctr *cursors2; | 
|---|
| 1722 | [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] drsuapi_DsReplicaCursor3Ctr *cursors3; | 
|---|
| 1723 | [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2; | 
|---|
| 1724 | [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2; | 
|---|
| 1725 | [case(DRSUAPI_DS_REPLICA_INFO_REPSTO)] drsuapi_DsReplicaNeighbourCtr *repsto; | 
|---|
| 1726 | [case(DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS)] drsuapi_DsReplicaConnection04Ctr *clientctx; | 
|---|
| 1727 | [case(DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1)] drsuapi_DsReplicaCursorCtrEx *udv1; | 
|---|
| 1728 | [case(DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS)] drsuapi_DsReplica06Ctr *srvoutgoingcalls; | 
|---|
| 1729 | } drsuapi_DsReplicaInfo; | 
|---|
| 1730 |  | 
|---|
| 1731 | WERROR drsuapi_DsReplicaGetInfo( | 
|---|
| 1732 | [in] policy_handle *bind_handle, | 
|---|
| 1733 | [in] drsuapi_DsReplicaGetInfoLevel level, | 
|---|
| 1734 | [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req, | 
|---|
| 1735 | [out,ref] drsuapi_DsReplicaInfoType *info_type, | 
|---|
| 1736 | [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info | 
|---|
| 1737 | ); | 
|---|
| 1738 |  | 
|---|
| 1739 | /*****************/ | 
|---|
| 1740 | /* Function 0x14 */ | 
|---|
| 1741 | [todo] WERROR DRSUAPI_ADD_SID_HISTORY(); | 
|---|
| 1742 |  | 
|---|
| 1743 | /*****************/ | 
|---|
| 1744 | /* Function 0x15 */ | 
|---|
| 1745 |  | 
|---|
| 1746 | typedef struct { | 
|---|
| 1747 | [range(0,10000)] uint32 num_entries; | 
|---|
| 1748 | [size_is(num_entries)] drsuapi_DsGetMembershipsCtr1 **ctrl_array; | 
|---|
| 1749 | } drsuapi_DsGetMemberships2Ctr1; | 
|---|
| 1750 |  | 
|---|
| 1751 | typedef [switch_type(uint32)] union { | 
|---|
| 1752 | [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1; | 
|---|
| 1753 | } drsuapi_DsGetMemberships2Ctr; | 
|---|
| 1754 |  | 
|---|
| 1755 | typedef struct { | 
|---|
| 1756 | [range(1,10000)] uint32 num_req; | 
|---|
| 1757 | [size_is(num_req)] drsuapi_DsGetMembershipsRequest1 **req_array; | 
|---|
| 1758 | } drsuapi_DsGetMemberships2Request1; | 
|---|
| 1759 |  | 
|---|
| 1760 | typedef [switch_type(uint32)] union { | 
|---|
| 1761 | [case(1)] drsuapi_DsGetMemberships2Request1 req1; | 
|---|
| 1762 | } drsuapi_DsGetMemberships2Request; | 
|---|
| 1763 |  | 
|---|
| 1764 | WERROR drsuapi_DsGetMemberships2( | 
|---|
| 1765 | [in] policy_handle *bind_handle, | 
|---|
| 1766 | [in] uint32 level, | 
|---|
| 1767 | [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req, | 
|---|
| 1768 | [out,ref] uint32 *level_out, | 
|---|
| 1769 | [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr | 
|---|
| 1770 | ); | 
|---|
| 1771 |  | 
|---|
| 1772 | /*****************/ | 
|---|
| 1773 | /* Function 0x16 */ | 
|---|
| 1774 | [todo] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS(); | 
|---|
| 1775 |  | 
|---|
| 1776 | /*****************/ | 
|---|
| 1777 | /* Function 0x17 */ | 
|---|
| 1778 | [todo] WERROR DRSUAPI_GET_OBJECT_EXISTENCE(); | 
|---|
| 1779 |  | 
|---|
| 1780 | /*****************/ | 
|---|
| 1781 | /* Function 0x18 */ | 
|---|
| 1782 | typedef struct { | 
|---|
| 1783 | WERROR error_code; | 
|---|
| 1784 | uint32 site_cost; | 
|---|
| 1785 | } drsuapi_DsSiteCostInfo; | 
|---|
| 1786 |  | 
|---|
| 1787 | typedef struct { | 
|---|
| 1788 | [range(0,10000)] uint32 num_info; | 
|---|
| 1789 | [size_is(num_info)] drsuapi_DsSiteCostInfo *info; | 
|---|
| 1790 | [value(0)] uint32 flags_reserved; | 
|---|
| 1791 | } drsuapi_QuerySitesByCostCtr1; | 
|---|
| 1792 |  | 
|---|
| 1793 | typedef [switch_type(uint32)] union { | 
|---|
| 1794 | [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1; | 
|---|
| 1795 | } drsuapi_QuerySitesByCostCtr; | 
|---|
| 1796 |  | 
|---|
| 1797 | typedef struct { | 
|---|
| 1798 | [charset(UTF16),string] uint16 *site_from; | 
|---|
| 1799 | [range(1,10000)] uint32 num_req; | 
|---|
| 1800 | [size_is(num_req)] [charset(UTF16),string] uint16 **site_to; | 
|---|
| 1801 | uint32 flags; | 
|---|
| 1802 | } drsuapi_QuerySitesByCostRequest1; | 
|---|
| 1803 |  | 
|---|
| 1804 | typedef [switch_type(uint32)] union { | 
|---|
| 1805 | [case(1)] drsuapi_QuerySitesByCostRequest1 req1; | 
|---|
| 1806 | } drsuapi_QuerySitesByCostRequest; | 
|---|
| 1807 |  | 
|---|
| 1808 | WERROR drsuapi_QuerySitesByCost( | 
|---|
| 1809 | [in] policy_handle *bind_handle, | 
|---|
| 1810 | [in] uint32 level, | 
|---|
| 1811 | [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req, | 
|---|
| 1812 | [out,ref] uint32 *level_out, | 
|---|
| 1813 | [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr | 
|---|
| 1814 | ); | 
|---|
| 1815 | } | 
|---|