idl:drsblobs add code to interpret msDS-TrustForestTrustInfo
[Samba.git] / librpc / idl / drsuapi.idl
blob94e527e5a77cd1dc7371e39705c8660353bd3cf1
1 #include "idl_types.h"
3 import "security.idl", "misc.idl", "samr.idl";
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)
14 interface drsuapi
16 typedef bitmap samr_GroupAttrs samr_GroupAttrs;
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;
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,
92 * the following 3 have the same value
93 * repadmin.exe /bind says that
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;
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;
110 /* this is used by w2k */
111 typedef struct {
112 drsuapi_SupportedExtensions supported_extensions;
113 GUID site_guid;
114 uint32 pid;
115 } drsuapi_DsBindInfo24;
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;
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;
135 typedef struct {
136 [flag(NDR_REMAINING)] DATA_BLOB info;
137 } drsuapi_DsBindInfoFallBack;
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;
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;
152 * but we don't want the caller to manually decode this blob,
153 * so we're doing it here
156 typedef struct {
157 [range(1,10000)] uint32 length;
158 [switch_is(length)] drsuapi_DsBindInfo info;
159 } drsuapi_DsBindInfoCtr;
161 /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
163 * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
165 const char *DRSUAPI_DS_BIND_GUID = "e24d201a-4fd6-11d1-a3da-0000f875ae0d";
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.
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";
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
180 /*****************/
181 /* Function 0x01 */
182 WERROR drsuapi_DsUnbind(
183 [in,out] policy_handle *bind_handle
186 /*****************/
187 /* Function 0x02 */
188 typedef [public,gensize] struct {
189 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, 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;
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;
204 typedef [switch_type(uint32)] union {
205 [case(1)] drsuapi_DsReplicaSyncRequest1 req1;
206 } drsuapi_DsReplicaSyncRequest;
208 WERROR drsuapi_DsReplicaSync(
209 [in] policy_handle *bind_handle,
210 [in] uint32 level,
211 [in,switch_is(level)] drsuapi_DsReplicaSyncRequest *req
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;
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;
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;
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;
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;
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;
280 * In DRSUAPI all attributes with syntax 2.5.5.2
281 * are identified by uint32 values
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
292 * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr
293 * array. The following are the default mappings of w2k3
295 * OID-prefix => UINT32-Id prefix
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
317 * Here's a list of used 'attributeSyntax' OID's
319 * 2.5.5.1 => Object(DS-DN) string
320 * struct drsuapi_DsObjectIdentifier3
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
328 * 2.5.5.4 => String(Teletex) case-insensitive string with teletex charset
330 * 2.5.5.5 => String(IA5) case-sensitive string
332 * 2.5.5.6 => String(Numeric)
333 * => eg. internationalISDNNumber
335 * 2.5.5.7 => Object(DN-Binary) B:<byte count>:<bytes>:<object DN>
336 * => e.g. wellKnownObjects
338 * 2.5.5.8 => BOOL
340 * 2.5.5.9 => int32
342 * 2.5.5.10 => DATA_BLOB
343 * => struct GUID
345 * 2.5.5.11 => LDAP timestring
346 * => NTTIME_1sec
348 * 2.5.5.12 => String(Unicode) case-insensitive string
349 * => 'standard strings'
351 * 2.5.5.13 => Object(Presentation-Address) string
352 * => used in objectClass applicationEntity
354 * 2.5.5.14 => Object(DN-String) S:<char count>:<string>:<object DN>
355 * => not used
357 * 2.5.5.15 => ntSecurityDescriptor
359 * 2.5.5.16 => int64
361 * 2.5.5.17 => dom_sid
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;
368 typedef struct {
369 uint32 id_prefix;
370 drsuapi_DsReplicaOID oid;
371 } drsuapi_DsReplicaOIDMapping;
373 typedef [public] struct {
374 [range(0,0x100000)] uint32 num_mappings;
375 [size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings;
376 } drsuapi_DsReplicaOIDMapping_Ctr;
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;
384 typedef [flag(NDR_PAHEX),v1_enum,public] enum {
385 DRSUAPI_ATTRIBUTE_objectClass = 0x00000000,
386 DRSUAPI_ATTRIBUTE_cn = 0x00000003,
387 DRSUAPI_ATTRIBUTE_description = 0x0000000d,
388 DRSUAPI_ATTRIBUTE_member = 0x0000001f,
389 DRSUAPI_ATTRIBUTE_instanceType = 0x00020001,
390 DRSUAPI_ATTRIBUTE_whenCreated = 0x00020002,
391 DRSUAPI_ATTRIBUTE_possSuperiors = 0x00020008,
392 DRSUAPI_ATTRIBUTE_hasMasterNCs = 0x0002000e,
393 DRSUAPI_ATTRIBUTE_subClassOf = 0x00020015,
394 DRSUAPI_ATTRIBUTE_governsID = 0x00020016,
395 DRSUAPI_ATTRIBUTE_mustContain = 0x00020018,
396 DRSUAPI_ATTRIBUTE_mayContain = 0x00020019,
397 DRSUAPI_ATTRIBUTE_rDNAttId = 0x0002001A,
398 DRSUAPI_ATTRIBUTE_attributeID = 0x0002001e,
399 DRSUAPI_ATTRIBUTE_attributeSyntax = 0x00020020,
400 DRSUAPI_ATTRIBUTE_isSingleValued = 0x00020021,
401 DRSUAPI_ATTRIBUTE_rangeLower = 0x00020022,
402 DRSUAPI_ATTRIBUTE_rangeUpper = 0x00020023,
403 DRSUAPI_ATTRIBUTE_dMDLocation = 0x00020024,
404 DRSUAPI_ATTRIBUTE_objectVersion = 0x0002004c,
405 DRSUAPI_ATTRIBUTE_invocationId = 0x00020073,
406 DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly = 0x000200a9,
407 DRSUAPI_ATTRIBUTE_adminDisplayName = 0x000200c2,
408 DRSUAPI_ATTRIBUTE_adminDescription = 0x000200e2,
409 DRSUAPI_ATTRIBUTE_oMSyntax = 0x000200e7,
410 DRSUAPI_ATTRIBUTE_ntSecurityDescriptor = 0x00020119,
411 DRSUAPI_ATTRIBUTE_searchFlags = 0x0002014e,
412 DRSUAPI_ATTRIBUTE_auxiliaryClass = 0x0002015f,
413 DRSUAPI_ATTRIBUTE_lDAPDisplayName = 0x000201cc,
414 DRSUAPI_ATTRIBUTE_name = 0x00090001,
415 DRSUAPI_ATTRIBUTE_userAccountControl = 0x00090008,
416 DRSUAPI_ATTRIBUTE_currentValue = 0x0009001b,
417 DRSUAPI_ATTRIBUTE_homeDirectory = 0x0009002c,
418 DRSUAPI_ATTRIBUTE_homeDrive = 0x0009002d,
419 DRSUAPI_ATTRIBUTE_scriptPath = 0x0009003e,
420 DRSUAPI_ATTRIBUTE_profilePath = 0x0009008b,
421 DRSUAPI_ATTRIBUTE_objectSid = 0x00090092,
422 DRSUAPI_ATTRIBUTE_schemaIDGUID = 0x00090094,
423 DRSUAPI_ATTRIBUTE_dBCSPwd = 0x00090037,/* lmPwdHash */
424 DRSUAPI_ATTRIBUTE_logonHours = 0x00090040,
425 DRSUAPI_ATTRIBUTE_userWorkstations = 0x00090056,
426 DRSUAPI_ATTRIBUTE_unicodePwd = 0x0009005a,/* ntPwdHash */
427 DRSUAPI_ATTRIBUTE_ntPwdHistory = 0x0009005e,
428 DRSUAPI_ATTRIBUTE_priorValue = 0x00090064,
429 DRSUAPI_ATTRIBUTE_supplementalCredentials = 0x0009007d,
430 DRSUAPI_ATTRIBUTE_trustAuthIncoming = 0x00090081,
431 DRSUAPI_ATTRIBUTE_trustAuthOutgoing = 0x00090087,
432 DRSUAPI_ATTRIBUTE_lmPwdHistory = 0x000900a0,
433 DRSUAPI_ATTRIBUTE_systemPossSuperiors = 0x000900c3,
434 DRSUAPI_ATTRIBUTE_systemMayContain = 0x000900c4,
435 DRSUAPI_ATTRIBUTE_systemMustContain = 0x000900c5,
436 DRSUAPI_ATTRIBUTE_systemAuxiliaryClass = 0x000900c6,
437 DRSUAPI_ATTRIBUTE_sAMAccountName = 0x000900dd,
438 DRSUAPI_ATTRIBUTE_sAMAccountType = 0x0009012e,
439 DRSUAPI_ATTRIBUTE_options = 0x00090133,
440 DRSUAPI_ATTRIBUTE_fSMORoleOwner = 0x00090171,
441 DRSUAPI_ATTRIBUTE_systemFlags = 0x00090177,
442 DRSUAPI_ATTRIBUTE_serverReference = 0x00090203,
443 DRSUAPI_ATTRIBUTE_serverReferenceBL = 0x00090204,
444 DRSUAPI_ATTRIBUTE_initialAuthIncoming = 0x0009021b,
445 DRSUAPI_ATTRIBUTE_initialAuthOutgoing = 0x0009021c,
446 DRSUAPI_ATTRIBUTE_wellKnownObjects = 0x0009026a,
447 DRSUAPI_ATTRIBUTE_dNSHostName = 0x0009026b,
448 DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet = 0x0009027f,
449 DRSUAPI_ATTRIBUTE_userPrincipalName = 0x00090290,
450 DRSUAPI_ATTRIBUTE_groupType = 0x000902ee,
451 DRSUAPI_ATTRIBUTE_servicePrincipalName = 0x00090303,
452 DRSUAPI_ATTRIBUTE_objectCategory = 0x0009030e,
453 DRSUAPI_ATTRIBUTE_gPLink = 0x0009037b,
454 DRSUAPI_ATTRIBUTE_transportAddressAttribute = 0x0009037f,
455 DRSUAPI_ATTRIBUTE_msDS_Behavior_Version = 0x000905b3,
456 DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber = 0x000906f6,
457 DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs = 0x0009071c,
458 DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c,
459 DRSUAPI_ATTRIBUTE_NONE = 0xFFFFFFFF
460 } drsuapi_DsAttributeId;
462 typedef struct {
463 [value(1)] uint32 version;
464 [value(0)] uint32 reserved1;
465 [range(1,0x100000)] uint32 num_attids;
466 [size_is(num_attids)] drsuapi_DsAttributeId attids[];
467 } drsuapi_DsPartialAttributeSet;
469 typedef struct {
470 GUID destination_dsa_guid;
471 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
472 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
473 drsuapi_DsReplicaHighWaterMark highwatermark;
474 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
475 drsuapi_DrsOptions replica_flags;
476 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
477 uint32 max_ndr_size; /* w2k3 seems to ignore this */
478 drsuapi_DsExtendedOperation extended_op;
479 hyper fsmo_info;
480 drsuapi_DsPartialAttributeSet *partial_attribute_set;
481 drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;
482 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
483 } drsuapi_DsGetNCChangesRequest8;
485 typedef struct {
486 GUID destination_dsa_guid;
487 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
488 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
489 drsuapi_DsReplicaHighWaterMark highwatermark;
490 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
491 drsuapi_DrsOptions replica_flags;
492 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
493 uint32 max_ndr_size; /* w2k3 seems to ignore this */
494 drsuapi_DsExtendedOperation extended_op;
495 hyper fsmo_info;
496 drsuapi_DsPartialAttributeSet *partial_attribute_set;
497 drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;
498 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
499 uint32 more_flags;
500 } drsuapi_DsGetNCChangesRequest10;
502 typedef [switch_type(uint32)] union {
503 [case(5)] drsuapi_DsGetNCChangesRequest5 req5;
504 [case(8)] drsuapi_DsGetNCChangesRequest8 req8;
505 [case(10)] drsuapi_DsGetNCChangesRequest10 req10;
506 } drsuapi_DsGetNCChangesRequest;
508 typedef [public] struct {
509 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
510 hyper highest_usn; /* updated after a full replication cycle */
511 NTTIME last_sync_success;
512 } drsuapi_DsReplicaCursor2;
514 typedef struct {
515 [value(2)] uint32 version;
516 [value(0)] uint32 reserved1;
517 [range(0,0x100000)] uint32 count;
518 [value(0)] uint32 reserved2;
519 [size_is(count)] drsuapi_DsReplicaCursor2 cursors[];
520 } drsuapi_DsReplicaCursor2CtrEx;
522 /* Generic DATA_BLOB values */
523 typedef struct {
524 [range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
525 DATA_BLOB *blob;
526 } drsuapi_DsAttributeValue;
528 typedef struct {
529 [range(0,10485760)] uint32 num_values;
530 [size_is(num_values)] drsuapi_DsAttributeValue *values;
531 } drsuapi_DsAttributeValueCtr;
533 /* DN String values */
534 typedef [public,gensize] struct {
535 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
536 [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
537 GUID guid;
538 dom_sid28 sid;
539 [value(strlen_m(dn))] uint32 __ndr_size_dn;
540 [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
541 } drsuapi_DsReplicaObjectIdentifier3;
543 typedef [public] struct {
544 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
545 [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
546 GUID guid;
547 dom_sid28 sid;
548 [value(strlen_m(dn))] uint32 __ndr_size_dn;
549 [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
550 [value(binary.length + 4)] uint32 __ndr_size_binary;
551 [flag(NDR_REMAINING)] DATA_BLOB binary;
552 } drsuapi_DsReplicaObjectIdentifier3Binary;
554 typedef [public] struct {
555 drsuapi_DsAttributeId attid;
556 drsuapi_DsAttributeValueCtr value_ctr;
557 } drsuapi_DsReplicaAttribute;
559 typedef struct {
560 [range(0,1048576)] uint32 num_attributes;
561 [size_is(num_attributes)] drsuapi_DsReplicaAttribute *attributes;
562 } drsuapi_DsReplicaAttributeCtr;
564 typedef [public] bitmap {
565 DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER = 0x00000001,
566 DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC = 0x00000002,
567 DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY = 0x00010000
568 } drsuapi_DsReplicaObjectFlags;
570 typedef [public] struct {
571 drsuapi_DsReplicaObjectIdentifier *identifier;
572 drsuapi_DsReplicaObjectFlags flags;
573 drsuapi_DsReplicaAttributeCtr attribute_ctr;
574 } drsuapi_DsReplicaObject;
576 typedef struct {
577 uint32 version;
578 NTTIME_1sec originating_change_time;
579 GUID originating_invocation_id;
580 hyper originating_usn;
581 } drsuapi_DsReplicaMetaData;
583 typedef [public] struct {
584 [range(0,1048576)] uint32 count;
585 [size_is(count)] drsuapi_DsReplicaMetaData meta_data[];
586 } drsuapi_DsReplicaMetaDataCtr;
588 typedef [public,noprint] struct {
589 drsuapi_DsReplicaObjectListItemEx *next_object;
590 drsuapi_DsReplicaObject object;
591 boolean32 is_nc_prefix;
592 GUID *parent_object_guid;
593 drsuapi_DsReplicaMetaDataCtr *meta_data_ctr;
594 } drsuapi_DsReplicaObjectListItemEx;
596 typedef [public,gensize] struct {
597 GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
598 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
599 drsuapi_DsReplicaObjectIdentifier *naming_context;
600 drsuapi_DsReplicaHighWaterMark old_highwatermark;
601 drsuapi_DsReplicaHighWaterMark new_highwatermark;
602 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
603 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
604 drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */
605 uint32 object_count;
606 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
607 [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
608 drsuapi_DsReplicaObjectListItemEx *first_object;
609 boolean32 more_data;
610 } drsuapi_DsGetNCChangesCtr1;
613 * if the DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE flag
614 * isn't there it means the value is deleted
616 typedef [public] bitmap {
617 DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE = 0x00000001
618 } drsuapi_DsLinkedAttributeFlags;
620 typedef [public] struct {
621 drsuapi_DsReplicaObjectIdentifier *identifier;
622 drsuapi_DsAttributeId attid;
623 drsuapi_DsAttributeValue value;
624 drsuapi_DsLinkedAttributeFlags flags;
625 NTTIME_1sec originating_add_time;
626 drsuapi_DsReplicaMetaData meta_data;
627 } drsuapi_DsReplicaLinkedAttribute;
629 /* [MS-DRSR] section 4.1.10.2.11 DRS_MSG_GETCHGREPLY_V6 */
630 typedef [public,gensize] struct {
631 GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
632 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
633 drsuapi_DsReplicaObjectIdentifier *naming_context;
634 drsuapi_DsReplicaHighWaterMark old_highwatermark;
635 drsuapi_DsReplicaHighWaterMark new_highwatermark;
636 drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;
637 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
638 drsuapi_DsExtendedError extended_ret;
639 uint32 object_count;
640 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
641 [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
642 drsuapi_DsReplicaObjectListItemEx *first_object;
643 boolean32 more_data;
644 uint32 nc_object_count; /* estimated amount of objects in the whole NC */
645 uint32 nc_linked_attributes_count; /* estimated amount of linked values in the whole NC */
646 [range(0,1048576)] uint32 linked_attributes_count;
647 [size_is(linked_attributes_count)] drsuapi_DsReplicaLinkedAttribute *linked_attributes;
648 WERROR drs_error;
649 } drsuapi_DsGetNCChangesCtr6;
651 typedef [public] struct {
652 [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr1 ctr1;
653 } drsuapi_DsGetNCChangesCtr1TS;
655 typedef [public] struct {
656 [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr6 ctr6;
657 } drsuapi_DsGetNCChangesCtr6TS;
659 typedef [nopush] struct {
660 uint32 decompressed_length;
661 uint32 compressed_length;
662 [subcontext(4),subcontext_size(compressed_length),
663 compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)]
664 drsuapi_DsGetNCChangesCtr1TS *ts;
665 } drsuapi_DsGetNCChangesMSZIPCtr1;
667 typedef [nopush] struct {
668 uint32 decompressed_length;
669 uint32 compressed_length;
670 [subcontext(4),subcontext_size(compressed_length),
671 compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)]
672 drsuapi_DsGetNCChangesCtr6TS *ts;
673 } drsuapi_DsGetNCChangesMSZIPCtr6;
675 typedef [nopush] struct {
676 uint32 decompressed_length;
677 uint32 compressed_length;
678 [subcontext(4),subcontext_size(compressed_length),
679 compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)]
680 drsuapi_DsGetNCChangesCtr1TS *ts;
681 } drsuapi_DsGetNCChangesXPRESSCtr1;
683 typedef [nopush] struct {
684 uint32 decompressed_length;
685 uint32 compressed_length;
686 [subcontext(4),subcontext_size(compressed_length),
687 compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)]
688 drsuapi_DsGetNCChangesCtr6TS *ts;
689 } drsuapi_DsGetNCChangesXPRESSCtr6;
691 typedef [enum16bit] enum {
692 DRSUAPI_COMPRESSION_TYPE_MSZIP = 2,
693 DRSUAPI_COMPRESSION_TYPE_XPRESS = 3
694 } drsuapi_DsGetNCChangesCompressionType;
696 typedef [nodiscriminant,flag(NDR_PAHEX)] union {
697 [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
698 [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr6 mszip6;
699 [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr1 xpress1;
700 [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr6 xpress6;
701 } drsuapi_DsGetNCChangesCompressedCtr;
703 typedef struct {
704 drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
705 } drsuapi_DsGetNCChangesCtr2;
707 typedef struct {
708 [range(0,6)] uint32 level;
709 [range(2,3)] drsuapi_DsGetNCChangesCompressionType type;
710 [switch_is(level | (type<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr;
711 } drsuapi_DsGetNCChangesCtr7;
713 typedef [switch_type(uint32)] union {
714 [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1;
715 [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2;
716 [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6;
717 [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7;
718 } drsuapi_DsGetNCChangesCtr;
720 WERROR drsuapi_DsGetNCChanges(
721 [in] policy_handle *bind_handle,
722 [in] uint32 level,
723 [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req,
724 [out,ref] uint32 *level_out,
725 [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr
728 /*****************/
729 /* Function 0x04 */
730 /* [MS-DRSR] 4.1.26 */
732 typedef struct {
733 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
734 [ref,charset(DOS),string] uint8 *dest_dsa_dns_name;
735 GUID dest_dsa_guid;
736 drsuapi_DrsOptions options;
737 } drsuapi_DsReplicaUpdateRefsRequest1;
739 typedef [switch_type(uint32)] union {
740 [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1;
741 } drsuapi_DsReplicaUpdateRefsRequest;
743 WERROR drsuapi_DsReplicaUpdateRefs(
744 [in] policy_handle *bind_handle,
745 [in] uint32 level,
746 [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req
749 /*****************/
750 /* Function 0x05 */
752 typedef struct {
753 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
754 [charset(UTF16),string] uint16 *source_dsa_address;
755 uint8 schedule[84];
756 drsuapi_DrsOptions options;
757 } drsuapi_DsReplicaAddRequest1;
759 typedef struct {
760 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
761 drsuapi_DsReplicaObjectIdentifier *source_dsa_dn;
762 drsuapi_DsReplicaObjectIdentifier *transport_dn;
763 [charset(UTF16),string] uint16 *source_dsa_address;
764 uint8 schedule[84];
765 drsuapi_DrsOptions options;
766 } drsuapi_DsReplicaAddRequest2;
768 typedef [switch_type(uint32)] union {
769 [case(1)] drsuapi_DsReplicaAddRequest1 req1;
770 [case(2)] drsuapi_DsReplicaAddRequest2 req2;
771 } drsuapi_DsReplicaAddRequest;
773 WERROR drsuapi_DsReplicaAdd(
774 [in] policy_handle *bind_handle,
775 [in] uint32 level,
776 [in,switch_is(level)] drsuapi_DsReplicaAddRequest req
780 /*****************/
781 /* Function 0x06 */
782 typedef struct {
783 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
784 [charset(UTF16),string] uint16 *source_dsa_address;
785 drsuapi_DrsOptions options;
786 } drsuapi_DsReplicaDelRequest1;
788 typedef [switch_type(uint32)] union {
789 [case(1)] drsuapi_DsReplicaDelRequest1 req1;
790 } drsuapi_DsReplicaDelRequest;
792 WERROR drsuapi_DsReplicaDel(
793 [in] policy_handle *bind_handle,
794 [in] uint32 level,
795 [in,switch_is(level)] drsuapi_DsReplicaDelRequest req
798 /*****************/
799 /* Function 0x07 */
801 typedef struct {
802 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
803 GUID source_dra;
804 [charset(UTF16),string] uint16 *source_dra_address;
805 uint8 schedule[84];
806 uint32 replica_flags;
807 uint32 modify_fields;
808 drsuapi_DrsOptions options;
809 } drsuapi_DsReplicaModRequest1;
811 typedef [switch_type(uint32)] union {
812 [case(1)] drsuapi_DsReplicaModRequest1 req1;
813 } drsuapi_DsReplicaModRequest;
815 WERROR drsuapi_DsReplicaMod(
816 [in] policy_handle *bind_handle,
817 [in] uint32 level,
818 [in,switch_is(level)] drsuapi_DsReplicaModRequest req
821 /*****************/
822 /* Function 0x08 */
823 [todo] WERROR DRSUAPI_VERIFY_NAMES();
825 /*****************/
826 /* Function 0x09 */
828 /* how are type 4 and 7 different from 2 and 3 ? */
829 typedef [v1_enum] enum {
830 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS = 1,
831 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS = 2,
832 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS = 3,
833 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 = 4,
834 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS = 5,
835 DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS = 6,
836 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2 = 7
837 } drsuapi_DsMembershipType;
839 typedef struct {
840 NTSTATUS status;
841 [range(0,10000)] uint32 num_memberships;
842 [range(0,10000)] uint32 num_sids;
843 [size_is(num_memberships)] drsuapi_DsReplicaObjectIdentifier **info_array;
844 [size_is(num_memberships)] samr_GroupAttrs *group_attrs;
845 [size_is(num_sids)] dom_sid28 **sids;
846 } drsuapi_DsGetMembershipsCtr1;
848 typedef [switch_type(uint32)] union {
849 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
850 } drsuapi_DsGetMembershipsCtr;
852 const int DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR = 0x1;
854 typedef struct {
855 [range(1,10000)] uint32 count;
856 [size_is(count)] drsuapi_DsReplicaObjectIdentifier **info_array;
857 uint32 flags;
858 [range(1,7)] drsuapi_DsMembershipType type;
859 drsuapi_DsReplicaObjectIdentifier *domain;
860 } drsuapi_DsGetMembershipsRequest1;
862 typedef [switch_type(uint32)] union {
863 [case(1)] drsuapi_DsGetMembershipsRequest1 req1;
864 } drsuapi_DsGetMembershipsRequest;
866 WERROR drsuapi_DsGetMemberships(
867 [in] policy_handle *bind_handle,
868 [in] uint32 level,
869 [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req,
870 [out,ref] uint32 *level_out,
871 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr
874 /*****************/
875 /* Function 0x0a */
876 [todo] WERROR DRSUAPI_INTER_DOMAIN_MOVE();
878 /*****************/
879 /* Function 0x0b */
880 typedef [bitmap32bit] bitmap {
881 DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG = 0x00000001,
882 DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS = 0x00000002
883 } drsuapi_DsGetNT4ChangeLogFlags;
885 typedef struct {
886 drsuapi_DsGetNT4ChangeLogFlags flags;
887 uint32 preferred_maximum_length;
888 [range(0,0x00A00000)] uint32 restart_length;
889 [size_is(restart_length)] uint8 *restart_data;
890 } drsuapi_DsGetNT4ChangeLogRequest1;
892 typedef [switch_type(uint32)] union {
893 [case(1)] drsuapi_DsGetNT4ChangeLogRequest1 req1;
894 } drsuapi_DsGetNT4ChangeLogRequest;
896 typedef struct {
897 [range(0,0x00A00000)] uint32 restart_length;
898 [range(0,0x00A00000)] uint32 log_length;
899 hyper sam_serial_number;
900 NTTIME sam_creation_time;
901 hyper builtin_serial_number;
902 NTTIME builtin_creation_time;
903 hyper lsa_serial_number;
904 NTTIME lsa_creation_time;
905 NTSTATUS status;
906 [size_is(restart_length)] uint8 *restart_data;
907 [size_is(log_length)] uint8 *log_data;
908 } drsuapi_DsGetNT4ChangeLogInfo1;
910 typedef [switch_type(uint32)] union {
911 [case(1)] drsuapi_DsGetNT4ChangeLogInfo1 info1;
912 } drsuapi_DsGetNT4ChangeLogInfo;
914 WERROR drsuapi_DsGetNT4ChangeLog(
915 [in] policy_handle *bind_handle,
916 [in] uint32 level,
917 [in,ref] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest *req,
918 [out,ref] uint32 *level_out,
919 [out,ref] [switch_is(*level_out)] drsuapi_DsGetNT4ChangeLogInfo *info
922 /*****************/
923 /* Function 0x0c */
924 typedef [v1_enum] enum {
925 DRSUAPI_DS_NAME_STATUS_OK = 0,
926 DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR = 1,
927 DRSUAPI_DS_NAME_STATUS_NOT_FOUND = 2,
928 DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE = 3,
929 DRSUAPI_DS_NAME_STATUS_NO_MAPPING = 4,
930 DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY = 5,
931 DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING = 6,
932 DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL = 7
933 } drsuapi_DsNameStatus;
935 typedef [v1_enum] enum {
936 DRSUAPI_DS_NAME_FLAG_NO_FLAGS = 0x0,
937 DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,
938 DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC = 0x2,
939 DRSUAPI_DS_NAME_FLAG_GCVERIFY = 0x4,
940 DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL = 0x8
941 } drsuapi_DsNameFlags;
943 typedef [v1_enum] enum {
944 DRSUAPI_DS_NAME_FORMAT_UNKNOWN = 0,
945 DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 1,
946 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 2,
947 DRSUAPI_DS_NAME_FORMAT_DISPLAY = 3,
948 DRSUAPI_DS_NAME_FORMAT_GUID = 6,
949 DRSUAPI_DS_NAME_FORMAT_CANONICAL = 7,
950 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 8,
951 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 9,
952 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 10,
953 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 11,
954 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 12
955 } drsuapi_DsNameFormat;
957 typedef struct {
958 [string,charset(UTF16)] uint16 *str;
959 } drsuapi_DsNameString;
961 typedef struct {
962 uint32 codepage; /* 0x000004e4 - 1252 is german codepage*/
963 uint32 language; /* 0x00000407 - german language ID*/
964 drsuapi_DsNameFlags format_flags;
965 drsuapi_DsNameFormat format_offered;
966 drsuapi_DsNameFormat format_desired;
967 [range(1,10000)] uint32 count;
968 [size_is(count)] drsuapi_DsNameString *names;
969 } drsuapi_DsNameRequest1;
971 typedef [switch_type(uint32)] union {
972 [case(1)] drsuapi_DsNameRequest1 req1;
973 } drsuapi_DsNameRequest;
975 typedef struct {
976 drsuapi_DsNameStatus status;
977 [charset(UTF16),string] uint16 *dns_domain_name;
978 [charset(UTF16),string] uint16 *result_name;
979 } drsuapi_DsNameInfo1;
981 typedef struct {
982 uint32 count;
983 [size_is(count)] drsuapi_DsNameInfo1 *array;
984 } drsuapi_DsNameCtr1;
986 typedef [switch_type(uint32)] union {
987 [case(1)] drsuapi_DsNameCtr1 *ctr1;
988 } drsuapi_DsNameCtr;
990 WERROR drsuapi_DsCrackNames(
991 [in] policy_handle *bind_handle,
992 [in] uint32 level,
993 [in,ref,switch_is(level)] drsuapi_DsNameRequest *req,
994 [out,ref] uint32 *level_out,
995 [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr
998 /*****************/
999 /* Function 0x0d */
1000 typedef [v1_enum] enum {
1001 DRSUAPI_DS_SPN_OPERATION_ADD = 0,
1002 DRSUAPI_DS_SPN_OPERATION_REPLACE= 1,
1003 DRSUAPI_DS_SPN_OPERATION_DELETE = 2
1004 } drsuapi_DsSpnOperation;
1006 typedef struct {
1007 drsuapi_DsSpnOperation operation;
1008 uint32 unknown1;
1009 [charset(UTF16),string] uint16 *object_dn;
1010 [range(0,10000)] uint32 count;
1011 [size_is(count)] drsuapi_DsNameString *spn_names;
1012 } drsuapi_DsWriteAccountSpnRequest1;
1014 typedef [switch_type(uint32)] union {
1015 [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1;
1016 } drsuapi_DsWriteAccountSpnRequest;
1018 typedef struct {
1019 WERROR status;
1020 } drsuapi_DsWriteAccountSpnResult1;
1022 typedef [switch_type(uint32)] union {
1023 [case(1)] drsuapi_DsWriteAccountSpnResult1 res1;
1024 } drsuapi_DsWriteAccountSpnResult;
1026 WERROR drsuapi_DsWriteAccountSpn(
1027 [in] policy_handle *bind_handle,
1028 [in] uint32 level,
1029 [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req,
1030 [out,ref] uint32 *level_out,
1031 [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res
1034 /*****************/
1035 /* Function 0x0e */
1036 typedef struct {
1037 [charset(UTF16),string] uint16 *server_dn;
1038 [charset(UTF16),string] uint16 *domain_dn;
1039 boolean32 commit;
1040 } drsuapi_DsRemoveDSServerRequest1;
1042 typedef [switch_type(uint32)] union {
1043 [case(1)] drsuapi_DsRemoveDSServerRequest1 req1;
1044 } drsuapi_DsRemoveDSServerRequest;
1046 typedef struct {
1047 boolean32 last_dc_in_domain;
1048 } drsuapi_DsRemoveDSServerResult1;
1050 typedef [switch_type(uint32)] union {
1051 [case(1)] drsuapi_DsRemoveDSServerResult1 res1;
1052 } drsuapi_DsRemoveDSServerResult;
1054 WERROR drsuapi_DsRemoveDSServer(
1055 [in] policy_handle *bind_handle,
1056 [in] uint32 level,
1057 [in,ref,switch_is(level)] drsuapi_DsRemoveDSServerRequest *req,
1058 [out,ref] uint32 *level_out,
1059 [out,ref,switch_is(*level_out)] drsuapi_DsRemoveDSServerResult *res
1062 /*****************/
1063 /* Function 0x0f */
1064 [todo] WERROR DRSUAPI_REMOVE_DS_DOMAIN();
1066 /*****************/
1067 /* Function 0x10 */
1068 typedef struct {
1069 [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */
1070 int32 level; /* specifies the switch level for the request */
1071 } drsuapi_DsGetDCInfoRequest1;
1073 typedef [switch_type(int32)] union {
1074 [case(1)] drsuapi_DsGetDCInfoRequest1 req1;
1075 } drsuapi_DsGetDCInfoRequest;
1077 typedef struct {
1078 [charset(UTF16),string] uint16 *netbios_name;
1079 [charset(UTF16),string] uint16 *dns_name;
1080 [charset(UTF16),string] uint16 *site_name;
1081 [charset(UTF16),string] uint16 *computer_dn;
1082 [charset(UTF16),string] uint16 *server_dn;
1083 uint32 is_pdc;
1084 uint32 is_enabled;
1085 } drsuapi_DsGetDCInfo1;
1087 typedef struct {
1088 [range(0,10000)] uint32 count;
1089 [size_is(count)] drsuapi_DsGetDCInfo1 *array;
1090 } drsuapi_DsGetDCInfoCtr1;
1092 typedef struct {
1093 [charset(UTF16),string] uint16 *netbios_name;
1094 [charset(UTF16),string] uint16 *dns_name;
1095 [charset(UTF16),string] uint16 *site_name;
1096 [charset(UTF16),string] uint16 *site_dn;
1097 [charset(UTF16),string] uint16 *computer_dn;
1098 [charset(UTF16),string] uint16 *server_dn;
1099 [charset(UTF16),string] uint16 *ntds_dn;
1100 uint32 is_pdc;
1101 uint32 is_enabled;
1102 uint32 is_gc;
1103 GUID site_guid;
1104 GUID computer_guid;
1105 GUID server_guid;
1106 GUID ntds_guid;
1107 } drsuapi_DsGetDCInfo2;
1109 typedef struct {
1110 [range(0,10000)] uint32 count;
1111 [size_is(count)] drsuapi_DsGetDCInfo2 *array;
1112 } drsuapi_DsGetDCInfoCtr2;
1114 typedef struct {
1115 [charset(UTF16),string] uint16 *netbios_name;
1116 [charset(UTF16),string] uint16 *dns_name;
1117 [charset(UTF16),string] uint16 *site_name;
1118 [charset(UTF16),string] uint16 *site_dn;
1119 [charset(UTF16),string] uint16 *computer_dn;
1120 [charset(UTF16),string] uint16 *server_dn;
1121 [charset(UTF16),string] uint16 *ntds_dn;
1122 uint32 is_pdc;
1123 uint32 is_enabled;
1124 uint32 is_gc;
1125 uint32 is_rodc;
1126 GUID site_guid;
1127 GUID computer_guid;
1128 GUID server_guid;
1129 GUID ntds_guid;
1130 } drsuapi_DsGetDCInfo3;
1132 typedef struct {
1133 [range(0,10000)] uint32 count;
1134 [size_is(count)] drsuapi_DsGetDCInfo3 *array;
1135 } drsuapi_DsGetDCInfoCtr3;
1138 * this represents an active connection to the
1139 * Directory System Agent (DSA)
1140 * this can be via LDAP or DRSUAPI
1142 typedef struct {
1143 [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
1144 uint32 unknown2;
1145 uint32 connection_time; /* in seconds */
1146 uint32 unknown4;
1147 uint32 unknown5;
1148 uint32 unknown6;
1150 * client_account can be the following:
1151 * "W2K3\Administrator"
1152 * "Administrator@W2K3"
1153 * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base"
1154 * ""
1155 * or NULL
1157 [charset(UTF16),string] uint16 *client_account;
1158 } drsuapi_DsGetDCConnection01;
1160 typedef struct {
1161 [range(0,10000)] uint32 count;
1162 [size_is(count)] drsuapi_DsGetDCConnection01 *array;
1163 } drsuapi_DsGetDCConnectionCtr01;
1165 typedef [v1_enum] enum {
1166 DRSUAPI_DC_INFO_CTR_1 = 1,
1167 DRSUAPI_DC_INFO_CTR_2 = 2,
1168 DRSUAPI_DC_INFO_CTR_3 = 3,
1169 DRSUAPI_DC_CONNECTION_CTR_01 = -1
1170 } drsuapi_DsGetDCInfoCtrLevels;
1172 typedef [switch_type(int32)] union {
1173 [case(DRSUAPI_DC_INFO_CTR_1)] drsuapi_DsGetDCInfoCtr1 ctr1;
1174 [case(DRSUAPI_DC_INFO_CTR_2)] drsuapi_DsGetDCInfoCtr2 ctr2;
1175 [case(DRSUAPI_DC_INFO_CTR_3)] drsuapi_DsGetDCInfoCtr3 ctr3;
1176 [case(DRSUAPI_DC_CONNECTION_CTR_01)] drsuapi_DsGetDCConnectionCtr01 ctr01;
1177 } drsuapi_DsGetDCInfoCtr;
1179 WERROR drsuapi_DsGetDomainControllerInfo(
1180 [in] policy_handle *bind_handle,
1181 [in] int32 level,
1182 [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req,
1183 [out,ref] int32 *level_out,
1184 [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr
1187 /*****************/
1188 /* Function 0x11 */
1189 typedef [public,noprint] struct {
1190 drsuapi_DsReplicaObjectListItem *next_object;
1191 drsuapi_DsReplicaObject object;
1192 } drsuapi_DsReplicaObjectListItem;
1195 * The DsAddEntry() call which creates a nTDSDSA object,
1196 * also adds a servicePrincipalName in the following form
1197 * to the computer account of the new domain controller
1198 * referenced by the "serverReferenece" attribute.
1200 * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name>
1202 * also note that the "serverReference" isn't added to the new object!
1204 const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID = "E3514235-4B06-11D1-AB04-00C04FC2DCD2";
1207 * please note the the current idl
1208 * for DsAddEntry does only parse
1209 * what I saw between 2 w2k3 boxes
1210 * in my dssync experiments I got some other replies
1211 * so all I want to say is that this is very incomplete yet...
1212 * --metze
1214 typedef struct {
1215 drsuapi_DsReplicaObjectListItem first_object;
1216 } drsuapi_DsAddEntryRequest2;
1218 typedef [switch_type(int32)] union {
1219 [case(2)] drsuapi_DsAddEntryRequest2 req2;
1220 } drsuapi_DsAddEntryRequest;
1222 typedef struct {
1223 uint32 unknown1;
1224 WERROR status;
1225 uint32 unknown2;
1226 uint16 unknown3;
1227 } drsuapi_DsAddEntryErrorInfoX;
1229 typedef struct {
1230 [range(0,10485760)] uint32 size;
1231 [size_is(size)] uint8 *data;
1232 } drsuapi_DsAddEntryExtraErrorBuffer;
1234 typedef struct {
1235 drsuapi_DsAddEntryErrorInfoX error;
1236 drsuapi_DsAttributeId attid;
1237 uint32 unknown2;
1238 drsuapi_DsAddEntryExtraErrorBuffer buffer;
1239 } drsuapi_DsAddEntryExtraError1;
1241 typedef /*[noprint]*/ struct {
1242 drsuapi_DsAddEntryErrorListItem1 *next;
1243 drsuapi_DsAddEntryExtraError1 error;
1244 } drsuapi_DsAddEntryErrorListItem1;
1246 typedef struct {
1247 drsuapi_DsReplicaObjectIdentifier *id;
1248 WERROR status;
1249 drsuapi_DsAddEntryErrorListItem1 first;
1250 } drsuapi_DsAddEntryErrorInfo1;
1252 typedef [switch_type(uint32)] union {
1253 [case(1)] drsuapi_DsAddEntryErrorInfo1 error1;
1254 /* [case(2)] drsuapi_DsAddEntryErrorInfo2 error2;
1255 [case(3)] drsuapi_DsAddEntryErrorInfo3 error3;
1256 */ [case(4)] drsuapi_DsAddEntryErrorInfoX errorX;
1257 [case(5)] drsuapi_DsAddEntryErrorInfoX errorX;
1258 [case(6)] drsuapi_DsAddEntryErrorInfoX errorX;
1259 [case(7)] drsuapi_DsAddEntryErrorInfoX errorX;
1260 } drsuapi_DsAddEntryErrorInfo;
1262 typedef struct {
1263 WERROR status;
1264 uint32 level;
1265 [switch_is(level)] drsuapi_DsAddEntryErrorInfo *info;
1266 } drsuapi_DsAddEntryError1;
1268 typedef [switch_type(uint32)] union {
1269 [case(1)] drsuapi_DsAddEntryError1 info1;
1270 } drsuapi_DsAddEntryError;
1272 typedef struct {
1273 GUID guid;
1274 dom_sid28 sid;
1275 } drsuapi_DsReplicaObjectIdentifier2;
1277 typedef struct {
1278 drsuapi_DsReplicaObjectIdentifier *id;
1279 uint32 unknown1;
1280 drsuapi_DsAddEntryErrorInfoX error;
1281 [range(0,10000)] uint32 count;
1282 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
1283 } drsuapi_DsAddEntryCtr2;
1285 typedef struct {
1286 drsuapi_DsReplicaObjectIdentifier *id;
1287 uint32 level;
1288 [switch_is(level)] drsuapi_DsAddEntryError *error;
1289 [range(0,10000)] uint32 count;
1290 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
1291 } drsuapi_DsAddEntryCtr3;
1293 typedef [switch_type(int32)] union {
1294 [case(2)] drsuapi_DsAddEntryCtr2 ctr2;
1295 [case(3)] drsuapi_DsAddEntryCtr3 ctr3;
1296 } drsuapi_DsAddEntryCtr;
1298 [public] WERROR drsuapi_DsAddEntry(
1299 [in] policy_handle *bind_handle,
1300 [in] int32 level,
1301 [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req,
1302 [out,ref] int32 *level_out,
1303 [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr
1306 /*****************/
1307 /* Function 0x12 */
1308 typedef bitmap {
1309 DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION = 0x00000001,
1310 DRSUAPI_DS_EXECUTE_KCC_DAMPED = 0x00000002
1311 } drsuapi_DsExecuteKCCFlags;
1313 typedef struct {
1314 uint32 taskID;
1315 drsuapi_DsExecuteKCCFlags flags;
1316 } drsuapi_DsExecuteKCC1;
1318 typedef [switch_type(uint32)] union {
1319 [case(1)] drsuapi_DsExecuteKCC1 ctr1;
1320 } drsuapi_DsExecuteKCCRequest;
1322 WERROR drsuapi_DsExecuteKCC(
1323 [in] policy_handle *bind_handle,
1324 [in] uint32 level,
1325 [in, ref, switch_is(level)] drsuapi_DsExecuteKCCRequest *req
1328 /*****************/
1329 /* Function 0x13 */
1330 typedef [v1_enum] enum {
1331 DRSUAPI_DS_REPLICA_GET_INFO = 1,
1332 DRSUAPI_DS_REPLICA_GET_INFO2 = 2
1333 } drsuapi_DsReplicaGetInfoLevel;
1335 typedef [v1_enum] enum {
1336 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS = 0,
1337 DRSUAPI_DS_REPLICA_INFO_CURSORS = 1,
1338 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA = 2,
1339 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES = 3,
1340 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES = 4,
1341 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS = 5,
1342 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA = 6,
1343 DRSUAPI_DS_REPLICA_INFO_CURSORS2 = 7,
1344 DRSUAPI_DS_REPLICA_INFO_CURSORS3 = 8,
1345 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 = 9,
1346 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 = 10,
1347 DRSUAPI_DS_REPLICA_INFO_REPSTO = -2,
1348 DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS = -4,
1349 DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1 = -5,
1350 DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS = -6
1351 } drsuapi_DsReplicaInfoType;
1353 typedef struct {
1354 drsuapi_DsReplicaInfoType info_type;
1355 [charset(UTF16),string] uint16 *object_dn;
1356 GUID source_dsa_guid;
1357 } drsuapi_DsReplicaGetInfoRequest1;
1359 typedef struct {
1360 drsuapi_DsReplicaInfoType info_type;
1361 [charset(UTF16),string] uint16 *object_dn;
1362 GUID source_dsa_guid;
1363 uint32 flags;
1364 [charset(UTF16),string] uint16 *attribute_name;
1365 [charset(UTF16),string] uint16 *value_dn_str;
1366 uint32 enumeration_context;
1367 } drsuapi_DsReplicaGetInfoRequest2;
1369 typedef [switch_type(drsuapi_DsReplicaGetInfoLevel)] union {
1370 [case(DRSUAPI_DS_REPLICA_GET_INFO)] drsuapi_DsReplicaGetInfoRequest1 req1;
1371 [case(DRSUAPI_DS_REPLICA_GET_INFO2)] drsuapi_DsReplicaGetInfoRequest2 req2;
1372 } drsuapi_DsReplicaGetInfoRequest;
1374 typedef struct {
1375 [charset(UTF16),string] uint16 *naming_context_dn;
1376 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
1377 [charset(UTF16),string] uint16 *source_dsa_address;
1378 [charset(UTF16),string] uint16 *transport_obj_dn;
1379 drsuapi_DrsOptions replica_flags;
1380 uint32 reserved;
1381 GUID naming_context_obj_guid;
1382 GUID source_dsa_obj_guid;
1383 GUID source_dsa_invocation_id;
1384 GUID transport_obj_guid;
1385 hyper tmp_highest_usn;
1386 hyper highest_usn;
1387 NTTIME last_success;
1388 NTTIME last_attempt;
1389 WERROR result_last_attempt;
1390 uint32 consecutive_sync_failures;
1391 } drsuapi_DsReplicaNeighbour;
1393 typedef struct {
1394 uint32 count;
1395 uint32 reserved;
1396 [size_is(count)] drsuapi_DsReplicaNeighbour array[];
1397 } drsuapi_DsReplicaNeighbourCtr;
1399 typedef struct {
1400 uint32 count;
1401 uint32 reserved;
1402 [size_is(count)] drsuapi_DsReplicaCursor array[];
1403 } drsuapi_DsReplicaCursorCtr;
1405 typedef struct {
1406 [charset(UTF16),string] uint16 *attribute_name;
1407 uint32 version;
1408 NTTIME originating_change_time;
1409 GUID originating_invocation_id;
1410 hyper originating_usn;
1411 hyper local_usn;
1412 } drsuapi_DsReplicaObjMetaData;
1414 typedef struct {
1415 uint32 count;
1416 uint32 reserved;
1417 [size_is(count)] drsuapi_DsReplicaObjMetaData array[];
1418 } drsuapi_DsReplicaObjMetaDataCtr;
1420 typedef struct {
1421 [charset(UTF16),string] uint16 *dsa_obj_dn;
1422 GUID dsa_obj_guid;
1423 NTTIME first_failure;
1424 uint32 num_failures;
1425 WERROR last_result;
1426 } drsuapi_DsReplicaKccDsaFailure;
1428 typedef struct {
1429 uint32 count;
1430 uint32 reserved;
1431 [size_is(count)] drsuapi_DsReplicaKccDsaFailure array[];
1432 } drsuapi_DsReplicaKccDsaFailuresCtr;
1434 typedef enum {
1435 DRSUAPI_DS_REPLICA_OP_TYPE_SYNC = 0,
1436 DRSUAPI_DS_REPLICA_OP_TYPE_ADD = 1,
1437 DRSUAPI_DS_REPLICA_OP_TYPE_DELETE = 2,
1438 DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY = 3,
1439 DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS = 4
1440 } drsuapi_DsReplicaOpType;
1442 typedef struct {
1443 NTTIME operation_start;
1444 uint32 serial_num; /* unique till reboot */
1445 uint32 priority;
1446 drsuapi_DsReplicaOpType operation_type;
1447 drsuapi_DrsOptions options;
1448 [charset(UTF16),string] uint16 *nc_dn;
1449 [charset(UTF16),string] uint16 *remote_dsa_obj_dn;
1450 [charset(UTF16),string] uint16 *remote_dsa_address;
1451 GUID nc_obj_guid;
1452 GUID remote_dsa_obj_guid;
1453 } drsuapi_DsReplicaOp;
1455 typedef struct {
1456 NTTIME time;
1457 uint32 count;
1458 [size_is(count)] drsuapi_DsReplicaOp array[];
1459 } drsuapi_DsReplicaOpCtr;
1461 typedef struct {
1462 [charset(UTF16),string] uint16 *attribute_name;
1463 [charset(UTF16),string] uint16 *object_dn;
1464 [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
1465 DATA_BLOB *binary;
1466 NTTIME deleted;
1467 NTTIME created;
1468 uint32 version;
1469 NTTIME originating_change_time;
1470 GUID originating_invocation_id;
1471 hyper originating_usn;
1472 hyper local_usn;
1473 } drsuapi_DsReplicaAttrValMetaData;
1475 typedef struct {
1476 uint32 count;
1477 uint32 enumeration_context;
1478 [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[];
1479 } drsuapi_DsReplicaAttrValMetaDataCtr;
1481 typedef struct {
1482 uint32 count;
1483 uint32 enumeration_context;
1484 [size_is(count)] drsuapi_DsReplicaCursor2 array[];
1485 } drsuapi_DsReplicaCursor2Ctr;
1487 typedef struct {
1488 GUID source_dsa_invocation_id;
1489 hyper highest_usn;
1490 NTTIME last_sync_success;
1491 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
1492 } drsuapi_DsReplicaCursor3;
1494 typedef struct {
1495 uint32 count;
1496 uint32 enumeration_context;
1497 [size_is(count)] drsuapi_DsReplicaCursor3 array[];
1498 } drsuapi_DsReplicaCursor3Ctr;
1500 typedef struct {
1501 [charset(UTF16),string] uint16 *attribute_name;
1502 uint32 version;
1503 NTTIME originating_change_time;
1504 GUID originating_invocation_id;
1505 hyper originating_usn;
1506 hyper local_usn;
1507 [charset(UTF16),string] uint16 *originating_dsa_dn;
1508 } drsuapi_DsReplicaObjMetaData2;
1510 typedef struct {
1511 uint32 count;
1512 uint32 enumeration_context;
1513 [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[];
1514 } drsuapi_DsReplicaObjMetaData2Ctr;
1516 typedef struct {
1517 [charset(UTF16),string] uint16 *attribute_name;
1518 [charset(UTF16),string] uint16 *object_dn;
1519 [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
1520 DATA_BLOB *binary;
1521 NTTIME deleted;
1522 NTTIME created;
1523 uint32 version;
1524 NTTIME originating_change_time;
1525 GUID originating_invocation_id;
1526 hyper originating_usn;
1527 hyper local_usn;
1528 [charset(UTF16),string] uint16 *originating_dsa_dn;
1529 } drsuapi_DsReplicaAttrValMetaData2;
1531 typedef struct {
1532 uint32 count;
1533 uint32 enumeration_context;
1534 [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[];
1535 } drsuapi_DsReplicaAttrValMetaData2Ctr;
1537 typedef struct {
1538 hyper u1; /* session number? */
1539 uint32 u2;
1540 uint32 u3;
1541 GUID bind_guid;
1542 NTTIME_1sec bind_time;
1543 [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
1544 uint32 u5; /* this is the same value the client used as pid in the DsBindInfoX struct */
1545 } drsuapi_DsReplicaConnection04;
1547 typedef struct {
1548 [range(0,10000)] uint32 count;
1549 uint32 reserved;
1550 [size_is(count)] drsuapi_DsReplicaConnection04 array[];
1551 } drsuapi_DsReplicaConnection04Ctr;
1553 typedef struct {
1554 [charset(UTF16),string] uint16 *str1;
1555 uint32 u1;
1556 uint32 u2;
1557 uint32 u3;
1558 uint32 u4;
1559 uint32 u5;
1560 hyper u6;
1561 uint32 u7;
1562 } drsuapi_DsReplica06;
1564 typedef struct {
1565 [range(0,256)] uint32 count;
1566 uint32 reserved;
1567 [size_is(count)] drsuapi_DsReplica06 array[];
1568 } drsuapi_DsReplica06Ctr;
1570 typedef [switch_type(drsuapi_DsReplicaInfoType)] union {
1571 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] drsuapi_DsReplicaNeighbourCtr *neighbours;
1572 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] drsuapi_DsReplicaCursorCtr *cursors;
1573 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] drsuapi_DsReplicaObjMetaDataCtr *objmetadata;
1574 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;
1575 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;
1576 [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] drsuapi_DsReplicaOpCtr *pendingops;
1577 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;
1578 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] drsuapi_DsReplicaCursor2Ctr *cursors2;
1579 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] drsuapi_DsReplicaCursor3Ctr *cursors3;
1580 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;
1581 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;
1582 [case(DRSUAPI_DS_REPLICA_INFO_REPSTO)] drsuapi_DsReplicaNeighbourCtr *repsto;
1583 [case(DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS)] drsuapi_DsReplicaConnection04Ctr *clientctx;
1584 [case(DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1)] drsuapi_DsReplicaCursorCtrEx *udv1;
1585 [case(DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS)] drsuapi_DsReplica06Ctr *srvoutgoingcalls;
1586 } drsuapi_DsReplicaInfo;
1588 WERROR drsuapi_DsReplicaGetInfo(
1589 [in] policy_handle *bind_handle,
1590 [in] drsuapi_DsReplicaGetInfoLevel level,
1591 [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req,
1592 [out,ref] drsuapi_DsReplicaInfoType *info_type,
1593 [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info
1596 /*****************/
1597 /* Function 0x14 */
1598 [todo] WERROR DRSUAPI_ADD_SID_HISTORY();
1600 /*****************/
1601 /* Function 0x15 */
1603 typedef struct {
1604 [range(0,10000)] uint32 num_entries;
1605 [size_is(num_entries)] drsuapi_DsGetMembershipsCtr1 **ctrl_array;
1606 } drsuapi_DsGetMemberships2Ctr1;
1608 typedef [switch_type(uint32)] union {
1609 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
1610 } drsuapi_DsGetMemberships2Ctr;
1612 typedef struct {
1613 [range(1,10000)] uint32 num_req;
1614 [size_is(num_req)] drsuapi_DsGetMembershipsRequest1 **req_array;
1615 } drsuapi_DsGetMemberships2Request1;
1617 typedef [switch_type(uint32)] union {
1618 [case(1)] drsuapi_DsGetMemberships2Request1 req1;
1619 } drsuapi_DsGetMemberships2Request;
1621 WERROR drsuapi_DsGetMemberships2(
1622 [in] policy_handle *bind_handle,
1623 [in] uint32 level,
1624 [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req,
1625 [out,ref] uint32 *level_out,
1626 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr
1629 /*****************/
1630 /* Function 0x16 */
1631 [todo] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS();
1633 /*****************/
1634 /* Function 0x17 */
1635 [todo] WERROR DRSUAPI_GET_OBJECT_EXISTENCE();
1637 /*****************/
1638 /* Function 0x18 */
1639 typedef struct {
1640 WERROR error_code;
1641 uint32 site_cost;
1642 } drsuapi_DsSiteCostInfo;
1644 typedef struct {
1645 [range(0,10000)] uint32 num_info;
1646 [size_is(num_info)] drsuapi_DsSiteCostInfo *info;
1647 [value(0)] uint32 flags_reserved;
1648 } drsuapi_QuerySitesByCostCtr1;
1650 typedef [switch_type(uint32)] union {
1651 [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1;
1652 } drsuapi_QuerySitesByCostCtr;
1654 typedef struct {
1655 [charset(UTF16),string] uint16 *site_from;
1656 [range(1,10000)] uint32 num_req;
1657 [size_is(num_req)] [charset(UTF16),string] uint16 **site_to;
1658 uint32 flags;
1659 } drsuapi_QuerySitesByCostRequest1;
1661 typedef [switch_type(uint32)] union {
1662 [case(1)] drsuapi_QuerySitesByCostRequest1 req1;
1663 } drsuapi_QuerySitesByCostRequest;
1665 WERROR drsuapi_QuerySitesByCost(
1666 [in] policy_handle *bind_handle,
1667 [in] uint32 level,
1668 [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req,
1669 [out,ref] uint32 *level_out,
1670 [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr