s4/python: flags
[Samba/aatanasov.git] / librpc / idl / drsuapi.idl
blob54abcbd52df072d8f75856301c83871a9608041d
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 /*****************/
19 /* Function 0x00 */
20 typedef [bitmap32bit] bitmap {
21 DRSUAPI_SUPPORTED_EXTENSION_BASE = 0x00000001,
22 DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION = 0x00000002,
23 DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI = 0x00000004,
24 DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2 = 0x00000008,
25 DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS = 0x00000010,
26 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 = 0x00000020,
27 DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION = 0x00000040,
28 DRSUAPI_SUPPORTED_EXTENSION_00000080 = 0x00000080,
29 DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE = 0x00000100,
30 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 = 0x00000200,
31 DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION = 0x00000400,
32 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2 = 0x00000800,
33 DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD= 0x00001000,
34 DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND = 0x00002000,
35 DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO = 0x00004000,
36 DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION = 0x00008000,
37 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01 = 0x00010000,
38 DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP = 0x00020000,
39 DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY = 0x00040000,
40 DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 = 0x00080000,
41 DRSUAPI_SUPPORTED_EXTENSION_00100000 = 0x00100000,
42 DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 = 0x00200000,
43 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 = 0x00400000,
44 DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS = 0x00800000,
45 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8 = 0x01000000,
46 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5 = 0x02000000,
47 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6 = 0x04000000,
49 * the following 3 have the same value
50 * repadmin.exe /bind says that
52 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3 = 0x08000000,
53 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 = 0x08000000,
54 DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT = 0x08000000,
55 DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS = 0x10000000,
56 DRSUAPI_SUPPORTED_EXTENSION_20000000 = 0x20000000,
57 DRSUAPI_SUPPORTED_EXTENSION_40000000 = 0x40000000,
58 DRSUAPI_SUPPORTED_EXTENSION_80000000 = 0x80000000
59 } drsuapi_SupportedExtensions;
61 typedef [bitmap32bit] bitmap {
62 DRSUAPI_SUPPORTED_EXTENSION_ADAM = 0x00000001,
63 DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 = 0x00000002
64 } drsuapi_SupportedExtensionsExt;
66 /* this is used by w2k */
67 typedef struct {
68 drsuapi_SupportedExtensions supported_extensions;
69 GUID site_guid;
70 uint32 pid;
71 } drsuapi_DsBindInfo24;
73 /* this is used by w2k3 */
74 typedef struct {
75 drsuapi_SupportedExtensions supported_extensions;
76 GUID site_guid;
77 uint32 pid;
78 uint32 repl_epoch;
79 } drsuapi_DsBindInfo28;
81 /* this is used by w2k8 */
82 typedef struct {
83 drsuapi_SupportedExtensions supported_extensions;
84 GUID site_guid;
85 uint32 pid;
86 uint32 repl_epoch;
87 drsuapi_SupportedExtensionsExt supported_extensions_ext;
88 GUID config_dn_guid;
89 } drsuapi_DsBindInfo48;
91 typedef struct {
92 [flag(NDR_REMAINING)] DATA_BLOB info;
93 } drsuapi_DsBindInfoFallBack;
95 typedef [nodiscriminant] union {
96 [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24;
97 [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28;
98 [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48;
99 [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;
100 } drsuapi_DsBindInfo;
102 /* the drsuapi_DsBindInfoCtr was this before
103 * typedef [flag(NDR_PAHEX)] struct {
104 * [range(1,10000)] uint32 length;
105 * [size_is(length)] uint8 data[];
106 * } drsuapi_DsBindInfo;
108 * but we don't want the caller to manually decode this blob,
109 * so we're doing it here
112 typedef struct {
113 [range(1,10000)] uint32 length;
114 [switch_is(length)] drsuapi_DsBindInfo info;
115 } drsuapi_DsBindInfoCtr;
117 /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
119 * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
121 const char *DRSUAPI_DS_BIND_GUID = "e24d201a-4fd6-11d1-a3da-0000f875ae0d";
123 * this magic guid are needed to fetch the whole tree with drsuapi_DsGetNCChanges()
124 * as administrator and this values are also used in the destination_dsa_guid field
125 * of drsuapi_DsGetNCChangesReq5/8 and the source_dsa_guid is zero.
127 const char *DRSUAPI_DS_BIND_GUID_W2K = "6abec3d1-3054-41c8-a362-5a0c5b7d5d71";
128 const char *DRSUAPI_DS_BIND_GUID_W2K3 = "6afab99c-6e26-464a-975f-f58f105218bc";
130 [public] WERROR drsuapi_DsBind(
131 [in,unique] GUID *bind_guid,
132 [in,out,unique] drsuapi_DsBindInfoCtr *bind_info,
133 [out] policy_handle *bind_handle
136 /*****************/
137 /* Function 0x01 */
138 WERROR drsuapi_DsUnbind(
139 [in,out] policy_handle *bind_handle
142 /*****************/
143 /* Function 0x02 */
144 typedef [public,gensize] struct {
145 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags)-4)] uint32 __ndr_size;
146 [value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid;
147 GUID guid;
148 dom_sid28 sid;
149 [value(strlen_m(dn))] uint32 __ndr_size_dn;
150 [charset(UTF16),size_is(__ndr_size_dn+1)] uint16 dn[];
151 } drsuapi_DsReplicaObjectIdentifier;
153 typedef [public] bitmap {
154 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION = 0x00000001,
155 DRSUAPI_DS_REPLICA_SYNC_WRITEABLE = 0x00000002,
156 DRSUAPI_DS_REPLICA_SYNC_PERIODIC = 0x00000004,
157 DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING = 0x00000008,
158 DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES = 0x00000010,
159 DRSUAPI_DS_REPLICA_SYNC_FULL = 0x00000020,
160 DRSUAPI_DS_REPLICA_SYNC_URGENT = 0x00000040,
161 DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD = 0x00000080,
162 DRSUAPI_DS_REPLICA_SYNC_FORCE = 0x00000100,
163 DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE = 0x00000200,
164 DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED = 0x00000400,
165 DRSUAPI_DS_REPLICA_SYNC_TWO_WAY = 0x00000800,
166 DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY = 0x00001000,
167 DRSUAPI_DS_REPLICA_SYNC_INITIAL = 0x00002000,
168 DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION = 0x00004000,
169 DRSUAPI_DS_REPLICA_SYNC_ABANDONED = 0x00008000,
170 DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS = 0x00010000,
171 DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET = 0x00020000,
172 DRSUAPI_DS_REPLICA_SYNC_REQUEUE = 0x00040000,
173 DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION = 0x00080000,
174 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA = 0x00100000,
175 DRSUAPI_DS_REPLICA_SYNC_CRITICAL = 0x00200000,
176 DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS = 0x00400000,
177 DRSUAPI_DS_REPLICA_SYNC_PREEMPTED = 0x00800000
178 } drsuapi_DsReplicaSyncOptions;
180 typedef struct {
181 drsuapi_DsReplicaObjectIdentifier *naming_context;
182 GUID source_dsa_guid;
183 astring *other_info; /* I assume this is related to the repsFromTo1OtherInfo dns_name */
184 drsuapi_DsReplicaSyncOptions options;
185 } drsuapi_DsReplicaSyncRequest1;
187 typedef [switch_type(int32)] union {
188 [case(1)] drsuapi_DsReplicaSyncRequest1 req1;
189 } drsuapi_DsReplicaSyncRequest;
191 WERROR drsuapi_DsReplicaSync(
192 [in] policy_handle *bind_handle,
193 [in] int32 level,
194 [in,switch_is(level)] drsuapi_DsReplicaSyncRequest req
197 /*****************/
198 /* Function 0x03 */
199 typedef [public] struct {
200 hyper tmp_highest_usn; /* updated after each object update */
201 hyper reserved_usn;
202 hyper highest_usn; /* updated after a full replication cycle */
203 } drsuapi_DsReplicaHighWaterMark;
205 typedef [public] struct {
206 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
207 hyper highest_usn; /* updated after a full replication cycle */
208 } drsuapi_DsReplicaCursor;
210 typedef struct {
211 [value(1)] uint32 version;
212 [value(0)] uint32 reserved1;
213 [range(0,0x100000)] uint32 count;
214 [value(0)] uint32 reserved2;
215 [size_is(count)] drsuapi_DsReplicaCursor cursors[];
216 } drsuapi_DsReplicaCursorCtrEx;
218 typedef [public] bitmap {
219 /* the _WRITEABLE flag indicates a replication with all attributes
221 * --metze
223 DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE = 0x00000010,
224 DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP = 0x00000020,
225 DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS = 0x00000040,
226 DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT = 0x00000080,
227 DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC = 0x00000200,
228 DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS = 0x00000800,
229 DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS = 0x00001000, /* was 0x00010000, */
230 DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET = 0x00002000, /* was 0x00020000, */
231 DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED = 0x00200000,
232 DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED = 0x01000000,
233 DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS = 0x04000000,
234 DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC = 0x08000000,
236 * the following NOTE applies to DsGetNCChangesRequest5:
237 * - the data is only compressed when 10 or more objects are replicated
238 * - but there could also be a size limit of 35 KBytes or something like that
239 * - the reply is DsGetNCChangesCtr2
240 * - maybe the same applies to DsGetNCChangesRequest8...
242 * --metze
244 DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES = 0x10000000,
245 DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS = 0x20000000,
246 DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET = 0x40000000
247 } drsuapi_DsReplicaNeighbourFlags;
249 typedef [flag(NDR_PAHEX),v1_enum] enum {
250 DRSUAPI_EXOP_NONE = 0x00000000,
251 DRSUAPI_EXOP_FSMO_REQ_ROLE = 0x00000001,
252 DRSUAPI_EXOP_FSMO_RID_ALLOC = 0x00000002,
253 DRSUAPI_EXOP_FSMO_RID_REQ_ROLE = 0x00000003,
254 DRSUAPI_EXOP_FSMO_REQ_PDC = 0x00000004,
255 DRSUAPI_EXOP_FSMO_ABANDON_ROLE = 0x00000005,
256 DRSUAPI_EXOP_REPL_OBJ = 0x00000006,
257 DRSUAPI_EXOP_REPL_SECRET = 0x00000007
258 } drsuapi_DsExtendedOperation;
260 typedef [flag(NDR_PAHEX),v1_enum] enum {
261 DRSUAPI_EXOP_ERR_NONE = 0x00000000,
262 DRSUAPI_EXOP_ERR_SUCCESS = 0x00000001,
263 DRSUAPI_EXOP_ERR_UNKNOWN_OP = 0x00000002,
264 DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER = 0x00000003,
265 DRSUAPI_EXOP_ERR_UPDATE_ERR = 0x00000004,
266 DRSUAPI_EXOP_ERR_EXCEPTION = 0x00000005,
267 DRSUAPI_EXOP_ERR_UNKNOWN_CALLER = 0x00000006,
268 DRSUAPI_EXOP_ERR_RID_ALLOC = 0x00000007,
269 DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED = 0x00000008,
270 DRSUAPI_EXOP_ERR_FMSO_PENDING_OP = 0x00000009,
271 DRSUAPI_EXOP_ERR_MISMATCH = 0x0000000A,
272 DRSUAPI_EXOP_ERR_COULDNT_CONTACT = 0x0000000B,
273 DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES = 0x0000000C,
274 DRSUAPI_EXOP_ERR_DIR_ERROR = 0x0000000D,
275 DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS = 0x0000000E,
276 DRSUAPI_EXOP_ERR_ACCESS_DENIED = 0x0000000F,
277 DRSUAPI_EXOP_ERR_PARAM_ERROR = 0x00000010
278 } drsuapi_DsExtendedError;
280 typedef struct {
281 GUID destination_dsa_guid;
282 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
283 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
284 drsuapi_DsReplicaHighWaterMark highwatermark;
285 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
286 drsuapi_DsReplicaNeighbourFlags replica_flags;
287 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
288 uint32 max_ndr_size; /* w2k3 seems to ignore this */
289 drsuapi_DsExtendedOperation extended_op;
290 hyper fsmo_info;
291 } drsuapi_DsGetNCChangesRequest5;
294 * In DRSUAPI all attributes with syntax 2.5.5.2
295 * are identified by uint32 values
297 * the following table shows the mapping used between the two representations
298 * e.g. - objectClass 'nTDSDSA' has governsID: 1.2.840.113556.1.5.7000.47
299 * and a UINT32-ID of '0x0017002F'.
300 * - so the OID 1.2.840.113556.1.5.7000.47 is splitted into a
301 * OID-prefix: 1.2.840.113556.1.5.7000
302 * and a value: 47 => 0x2F
303 * - the mapping table gives a UINT32-prefix: 0x00170000
304 * - and the UINT32-ID is 0x0017002F = 0x00170000 | 0x2F
306 * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr
307 * array. The following are the default mappings of w2k3
309 * OID-prefix => UINT32-Id prefix
311 * 2.5.4.* => 0x00000000 (standard attributes RFC2256 core.schema)
312 * 2.5.6.* => 0x00010000 (standard object classes RFC2256 core.schema)
313 * 1.2.840.113556.1.2.* => 0x00020000
314 * 1.2.840.113556.1.3.* => 0x00030000
315 * 2.5.5.* => 0x00080000 (attributeSyntax OID's)
316 * 1.2.840.113556.1.4.* => 0x00090000
317 * 1.2.840.113556.1.5.* => 0x000A0000
318 * 2.16.840.1.113730.3.* => 0x00140000
319 * 0.9.2342.19200300.100.1.* => 0x00150000
320 * 2.16.840.1.113730.3.1.* => 0x00160000
321 * 1.2.840.113556.1.5.7000.* => 0x00170000
322 * 2.5.21.* => 0x00180000 (attrs for SubSchema)
323 * 2.5.18.* => 0x00190000 (createTimeStamp,modifyTimeStamp, SubSchema)
324 * 2.5.20.* => 0x001A0000
325 * 1.3.6.1.4.1.1466.101.119.* => 0x001B0000 (dynamicObject, entryTTL)
326 * 2.16.840.1.113730.3.2.* => 0x001C0000
327 * 1.3.6.1.4.1.250.1.* => 0x001D0000
328 * 1.2.840.113549.1.9.* => 0x001E0000 (unstructuredAddress,unstructuredName)
329 * 0.9.2342.19200300.100.4.* => 0x001F0000
331 * Here's a list of used 'attributeSyntax' OID's
333 * 2.5.5.1 => Object(DS-DN) string
334 * struct drsuapi_DsObjectIdentifier3
336 * 2.5.5.2 => OID-string
337 * => all values are represented as uint32 values in drsuapi
338 * => governsID, attributeID and attributeSyntax returned as OID-Strings in LDAP
339 * => mayContain, mustContain and all other attributes with 2.5.5.2 syntax
340 * are returned as attribute names
342 * 2.5.5.4 => String(Teletex) case-insensitive string with teletex charset
344 * 2.5.5.5 => String(IA5) case-sensitive string
346 * 2.5.5.6 => String(Numeric)
347 * => eg. internationalISDNNumber
349 * 2.5.5.7 => Object(DN-Binary) B:<byte count>:<bytes>:<object DN>
350 * => e.g. wellKnownObjects
352 * 2.5.5.8 => BOOL
354 * 2.5.5.9 => int32
356 * 2.5.5.10 => DATA_BLOB
357 * => struct GUID
359 * 2.5.5.11 => LDAP timestring
360 * => NTTIME_1sec
362 * 2.5.5.12 => String(Unicode) case-insensitive string
363 * => 'standard strings'
365 * 2.5.5.13 => Object(Presentation-Address) string
366 * => used in objectClass applicationEntity
368 * 2.5.5.14 => Object(DN-String) S:<char count>:<string>:<object DN>
369 * => not used
371 * 2.5.5.15 => ntSecurityDescriptor
373 * 2.5.5.16 => int64
375 * 2.5.5.17 => dom_sid
377 typedef [nopush,nopull] struct {
378 [range(0,10000),value(ndr_size_drsuapi_DsReplicaOID_oid(oid, 0))] uint32 __ndr_size;
379 [size_is(__ndr_size),charset(DOS)] uint8 *oid; /* it's encoded with asn1_write_OID_String() */
380 } drsuapi_DsReplicaOID;
382 typedef struct {
383 uint32 id_prefix;
384 drsuapi_DsReplicaOID oid;
385 } drsuapi_DsReplicaOIDMapping;
387 typedef [public] struct {
388 [range(0,0x100000)] uint32 num_mappings;
389 [size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings;
390 } drsuapi_DsReplicaOIDMapping_Ctr;
392 typedef [flag(NDR_PAHEX),v1_enum] enum {
393 DRSUAPI_OBJECTCLASS_top = 0x00010000,
394 DRSUAPI_OBJECTCLASS_classSchema = 0x0003000d,
395 DRSUAPI_OBJECTCLASS_attributeSchema = 0x0003000e
396 } drsuapi_DsObjectClassId;
398 typedef [flag(NDR_PAHEX),v1_enum,public] enum {
399 DRSUAPI_ATTRIBUTE_objectClass = 0x00000000,
400 DRSUAPI_ATTRIBUTE_description = 0x0000000d,
401 DRSUAPI_ATTRIBUTE_member = 0x0000001f,
402 DRSUAPI_ATTRIBUTE_instanceType = 0x00020001,
403 DRSUAPI_ATTRIBUTE_whenCreated = 0x00020002,
404 DRSUAPI_ATTRIBUTE_possSuperiors = 0x00020008,
405 DRSUAPI_ATTRIBUTE_hasMasterNCs = 0x0002000e,
406 DRSUAPI_ATTRIBUTE_subClassOf = 0x00020015,
407 DRSUAPI_ATTRIBUTE_governsID = 0x00020016,
408 DRSUAPI_ATTRIBUTE_mustContain = 0x00020018,
409 DRSUAPI_ATTRIBUTE_mayContain = 0x00020019,
410 DRSUAPI_ATTRIBUTE_attributeID = 0x0002001e,
411 DRSUAPI_ATTRIBUTE_attributeSyntax = 0x00020020,
412 DRSUAPI_ATTRIBUTE_isSingleValued = 0x00020021,
413 DRSUAPI_ATTRIBUTE_rangeLower = 0x00020022,
414 DRSUAPI_ATTRIBUTE_rangeUpper = 0x00020023,
415 DRSUAPI_ATTRIBUTE_dMDLocation = 0x00020024,
416 DRSUAPI_ATTRIBUTE_objectVersion = 0x0002004c,
417 DRSUAPI_ATTRIBUTE_invocationId = 0x00020073,
418 DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly = 0x000200a9,
419 DRSUAPI_ATTRIBUTE_adminDisplayName = 0x000200c2,
420 DRSUAPI_ATTRIBUTE_adminDescription = 0x000200e2,
421 DRSUAPI_ATTRIBUTE_oMSyntax = 0x000200e7,
422 DRSUAPI_ATTRIBUTE_ntSecurityDescriptor = 0x00020119,
423 DRSUAPI_ATTRIBUTE_searchFlags = 0x0002014e,
424 DRSUAPI_ATTRIBUTE_auxiliaryClass = 0x0002015f,
425 DRSUAPI_ATTRIBUTE_lDAPDisplayName = 0x000201cc,
426 DRSUAPI_ATTRIBUTE_name = 0x00090001,
427 DRSUAPI_ATTRIBUTE_userAccountControl = 0x00090008,
428 DRSUAPI_ATTRIBUTE_currentValue = 0x0009001b,
429 DRSUAPI_ATTRIBUTE_homeDirectory = 0x0009002c,
430 DRSUAPI_ATTRIBUTE_homeDrive = 0x0009002d,
431 DRSUAPI_ATTRIBUTE_scriptPath = 0x0009003e,
432 DRSUAPI_ATTRIBUTE_profilePath = 0x0009008b,
433 DRSUAPI_ATTRIBUTE_objectSid = 0x00090092,
434 DRSUAPI_ATTRIBUTE_schemaIDGUID = 0x00090094,
435 DRSUAPI_ATTRIBUTE_dBCSPwd = 0x00090037,/* lmPwdHash */
436 DRSUAPI_ATTRIBUTE_logonHours = 0x00090040,
437 DRSUAPI_ATTRIBUTE_userWorkstations = 0x00090056,
438 DRSUAPI_ATTRIBUTE_unicodePwd = 0x0009005a,/* ntPwdHash */
439 DRSUAPI_ATTRIBUTE_ntPwdHistory = 0x0009005e,
440 DRSUAPI_ATTRIBUTE_priorValue = 0x00090064,
441 DRSUAPI_ATTRIBUTE_supplementalCredentials = 0x0009007d,
442 DRSUAPI_ATTRIBUTE_trustAuthIncoming = 0x00090081,
443 DRSUAPI_ATTRIBUTE_trustAuthOutgoing = 0x00090087,
444 DRSUAPI_ATTRIBUTE_lmPwdHistory = 0x000900a0,
445 DRSUAPI_ATTRIBUTE_systemPossSuperiors = 0x000900c3,
446 DRSUAPI_ATTRIBUTE_systemMayContain = 0x000900c4,
447 DRSUAPI_ATTRIBUTE_systemMustContain = 0x000900c5,
448 DRSUAPI_ATTRIBUTE_sAMAccountName = 0x000900dd,
449 DRSUAPI_ATTRIBUTE_sAMAccountType = 0x0009012e,
450 DRSUAPI_ATTRIBUTE_fSMORoleOwner = 0x00090171,
451 DRSUAPI_ATTRIBUTE_systemFlags = 0x00090177,
452 DRSUAPI_ATTRIBUTE_serverReference = 0x00090203,
453 DRSUAPI_ATTRIBUTE_serverReferenceBL = 0x00090204,
454 DRSUAPI_ATTRIBUTE_initialAuthIncoming = 0x0009021b,
455 DRSUAPI_ATTRIBUTE_initialAuthOutgoing = 0x0009021c,
456 DRSUAPI_ATTRIBUTE_wellKnownObjects = 0x0009026a,
457 DRSUAPI_ATTRIBUTE_dNSHostName = 0x0009026b,
458 DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet = 0x0009027f,
459 DRSUAPI_ATTRIBUTE_userPrincipalName = 0x00090290,
460 DRSUAPI_ATTRIBUTE_groupType = 0x000902ee,
461 DRSUAPI_ATTRIBUTE_servicePrincipalName = 0x00090303,
462 DRSUAPI_ATTRIBUTE_objectCategory = 0x0009030e,
463 DRSUAPI_ATTRIBUTE_gPLink = 0x0009037b,
464 DRSUAPI_ATTRIBUTE_msDS_Behavior_Version = 0x000905b3,
465 DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber = 0x000906f6,
466 DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs = 0x0009071c,
467 DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c
468 } drsuapi_DsAttributeId;
470 typedef struct {
471 [value(1)] uint32 version;
472 [value(0)] uint32 reserved1;
473 [range(1,0x100000)] uint32 num_attids;
474 [size_is(num_attids)] drsuapi_DsAttributeId attids[];
475 } drsuapi_DsPartialAttributeSet;
477 typedef struct {
478 GUID destination_dsa_guid;
479 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
480 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
481 drsuapi_DsReplicaHighWaterMark highwatermark;
482 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
483 drsuapi_DsReplicaNeighbourFlags replica_flags;
484 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
485 uint32 max_ndr_size; /* w2k3 seems to ignore this */
486 drsuapi_DsExtendedOperation extended_op;
487 hyper fsmo_info;
488 drsuapi_DsPartialAttributeSet *partial_attribute_set;
489 drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;
490 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
491 } drsuapi_DsGetNCChangesRequest8;
493 typedef struct {
494 GUID destination_dsa_guid;
495 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
496 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
497 drsuapi_DsReplicaHighWaterMark highwatermark;
498 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
499 drsuapi_DsReplicaNeighbourFlags replica_flags;
500 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
501 uint32 max_ndr_size; /* w2k3 seems to ignore this */
502 drsuapi_DsExtendedOperation extended_op;
503 hyper fsmo_info;
504 drsuapi_DsPartialAttributeSet *partial_attribute_set;
505 drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;
506 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
507 uint32 more_flags;
508 } drsuapi_DsGetNCChangesRequest10;
510 typedef [switch_type(int32)] union {
511 [case(5)] drsuapi_DsGetNCChangesRequest5 req5;
512 [case(8)] drsuapi_DsGetNCChangesRequest8 req8;
513 [case(10)] drsuapi_DsGetNCChangesRequest10 req10;
514 } drsuapi_DsGetNCChangesRequest;
516 typedef [public] struct {
517 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
518 hyper highest_usn; /* updated after a full replication cycle */
519 NTTIME last_sync_success;
520 } drsuapi_DsReplicaCursor2;
522 typedef struct {
523 [value(2)] uint32 version;
524 [value(0)] uint32 reserved1;
525 [range(0,0x100000)] uint32 count;
526 [value(0)] uint32 reserved2;
527 [size_is(count)] drsuapi_DsReplicaCursor2 cursors[];
528 } drsuapi_DsReplicaCursor2CtrEx;
530 /* Generic DATA_BLOB values */
531 typedef struct {
532 [range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
533 DATA_BLOB *blob;
534 } drsuapi_DsAttributeValue;
536 typedef struct {
537 [range(0,10485760)] uint32 num_values;
538 [size_is(num_values)] drsuapi_DsAttributeValue *values;
539 } drsuapi_DsAttributeValueCtr;
541 /* DN String values */
542 typedef [public,gensize] struct {
543 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
544 [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
545 GUID guid;
546 dom_sid28 sid;
547 [value(strlen_m(dn))] uint32 __ndr_size_dn;
548 [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
549 } drsuapi_DsReplicaObjectIdentifier3;
551 typedef [public,gensize] struct {
552 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->iconv_convenience, 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 [value(binary.length + 4)] uint32 __ndr_size_binary;
559 [flag(NDR_REMAINING)] DATA_BLOB binary;
560 } drsuapi_DsReplicaObjectIdentifier3Binary;
562 typedef [public] struct {
563 drsuapi_DsAttributeId attid;
564 drsuapi_DsAttributeValueCtr value_ctr;
565 } drsuapi_DsReplicaAttribute;
567 typedef struct {
568 [range(0,1048576)] uint32 num_attributes;
569 [size_is(num_attributes)] drsuapi_DsReplicaAttribute *attributes;
570 } drsuapi_DsReplicaAttributeCtr;
572 typedef [public] bitmap {
573 DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER = 0x00000001,
574 DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC = 0x00000002,
575 DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY = 0x00010000
576 } drsuapi_DsReplicaObjectFlags;
578 typedef [public] struct {
579 drsuapi_DsReplicaObjectIdentifier *identifier;
580 drsuapi_DsReplicaObjectFlags flags;
581 drsuapi_DsReplicaAttributeCtr attribute_ctr;
582 } drsuapi_DsReplicaObject;
584 typedef struct {
585 uint32 version;
586 NTTIME_1sec originating_change_time;
587 GUID originating_invocation_id;
588 hyper originating_usn;
589 } drsuapi_DsReplicaMetaData;
591 typedef [public] struct {
592 [range(0,1048576)] uint32 count;
593 [size_is(count)] drsuapi_DsReplicaMetaData meta_data[];
594 } drsuapi_DsReplicaMetaDataCtr;
596 typedef [public,noprint] struct {
597 drsuapi_DsReplicaObjectListItemEx *next_object;
598 drsuapi_DsReplicaObject object;
599 boolean32 is_nc_prefix;
600 GUID *parent_object_guid;
601 drsuapi_DsReplicaMetaDataCtr *meta_data_ctr;
602 } drsuapi_DsReplicaObjectListItemEx;
604 typedef [public,gensize] struct {
605 GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
606 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
607 drsuapi_DsReplicaObjectIdentifier *naming_context;
608 drsuapi_DsReplicaHighWaterMark old_highwatermark;
609 drsuapi_DsReplicaHighWaterMark new_highwatermark;
610 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
611 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
612 drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */
613 uint32 object_count;
614 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
615 [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
616 drsuapi_DsReplicaObjectListItemEx *first_object;
617 boolean32 more_data;
618 } drsuapi_DsGetNCChangesCtr1;
621 * if the DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE flag
622 * isn't there it means the value is deleted
624 typedef [public] bitmap {
625 DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE = 0x00000001
626 } drsuapi_DsLinkedAttributeFlags;
628 typedef [public] struct {
629 drsuapi_DsReplicaObjectIdentifier *identifier;
630 drsuapi_DsAttributeId attid;
631 drsuapi_DsAttributeValue value;
632 drsuapi_DsLinkedAttributeFlags flags;
633 NTTIME_1sec originating_add_time;
634 drsuapi_DsReplicaMetaData meta_data;
635 } drsuapi_DsReplicaLinkedAttribute;
637 /* [MS-DRSR] section 4.1.10.2.11 DRS_MSG_GETCHGREPLY_V6 */
638 typedef [public,gensize] struct {
639 GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
640 GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
641 drsuapi_DsReplicaObjectIdentifier *naming_context;
642 drsuapi_DsReplicaHighWaterMark old_highwatermark;
643 drsuapi_DsReplicaHighWaterMark new_highwatermark;
644 drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;
645 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
646 drsuapi_DsExtendedError extended_ret;
647 uint32 object_count;
648 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
649 [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
650 drsuapi_DsReplicaObjectListItemEx *first_object;
651 boolean32 more_data;
652 uint32 nc_object_count; /* estimated amount of objects in the whole NC */
653 uint32 nc_linked_attributes_count; /* estimated amount of linked values in the whole NC */
654 [range(0,1048576)] uint32 linked_attributes_count;
655 [size_is(linked_attributes_count)] drsuapi_DsReplicaLinkedAttribute *linked_attributes;
656 WERROR drs_error;
657 } drsuapi_DsGetNCChangesCtr6;
659 typedef [public] struct {
660 [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr1 ctr1;
661 } drsuapi_DsGetNCChangesCtr1TS;
663 typedef [public] struct {
664 [subcontext(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr6 ctr6;
665 } drsuapi_DsGetNCChangesCtr6TS;
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_DsGetNCChangesCtr1TS *ts;
673 } drsuapi_DsGetNCChangesMSZIPCtr1;
675 typedef [nopush] struct {
676 uint32 decompressed_length;
677 uint32 compressed_length;
678 [subcontext(4),subcontext_size(compressed_length),
679 compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)]
680 drsuapi_DsGetNCChangesCtr6TS *ts;
681 } drsuapi_DsGetNCChangesMSZIPCtr6;
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_DsGetNCChangesCtr1TS *ts;
689 } drsuapi_DsGetNCChangesXPRESSCtr1;
691 typedef [nopush] struct {
692 uint32 decompressed_length;
693 uint32 compressed_length;
694 [subcontext(4),subcontext_size(compressed_length),
695 compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)]
696 drsuapi_DsGetNCChangesCtr6TS *ts;
697 } drsuapi_DsGetNCChangesXPRESSCtr6;
699 typedef [enum16bit] enum {
700 DRSUAPI_COMPRESSION_TYPE_MSZIP = 2,
701 DRSUAPI_COMPRESSION_TYPE_XPRESS = 3
702 } drsuapi_DsGetNCChangesCompressionType;
704 typedef [nodiscriminant,flag(NDR_PAHEX)] union {
705 [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
706 [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr6 mszip6;
707 [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr1 xpress1;
708 [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr6 xpress6;
709 } drsuapi_DsGetNCChangesCompressedCtr;
711 typedef struct {
712 drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
713 } drsuapi_DsGetNCChangesCtr2;
715 typedef struct {
716 [range(0,6)] int32 level;
717 [range(2,3)] drsuapi_DsGetNCChangesCompressionType type;
718 [switch_is(level | (type<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr;
719 } drsuapi_DsGetNCChangesCtr7;
721 typedef [switch_type(int32)] union {
722 [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1;
723 [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2;
724 [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6;
725 [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7;
726 } drsuapi_DsGetNCChangesCtr;
728 WERROR drsuapi_DsGetNCChanges(
729 [in] policy_handle *bind_handle,
730 [in] int32 level,
731 [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req,
732 [out,ref] int32 *level_out,
733 [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr
736 /*****************/
737 /* Function 0x04 */
738 /* [MS-DRSR] 4.1.26 */
739 typedef bitmap {
740 DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION = 0x00000001,
741 DRSUAPI_DS_REPLICA_UPDATE_GETCHG_CHECK = 0x00000002,
742 DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE = 0x00000004,
743 DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE = 0x00000008,
744 DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE = 0x00000010
745 } drsuapi_DsReplicaUpdateRefsOptions;
747 typedef struct {
748 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
749 [ref,charset(DOS),string] uint8 *dest_dsa_dns_name;
750 GUID dest_dsa_guid;
751 drsuapi_DsReplicaUpdateRefsOptions options;
752 } drsuapi_DsReplicaUpdateRefsRequest1;
754 typedef [switch_type(int32)] union {
755 [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1;
756 } drsuapi_DsReplicaUpdateRefsRequest;
758 WERROR drsuapi_DsReplicaUpdateRefs(
759 [in] policy_handle *bind_handle,
760 [in] int32 level,
761 [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req
764 /*****************/
765 /* Function 0x05 */
766 typedef bitmap {
767 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,
768 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002
769 /* TODO ... */
770 } drsuapi_DsReplicaAddOptions;
773 typedef struct {
774 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
775 [charset(UTF16),string] uint16 *source_dsa_address;
776 uint8 schedule[84];
777 drsuapi_DsReplicaAddOptions options;
778 } drsuapi_DsReplicaAddRequest1;
780 typedef struct {
781 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
782 drsuapi_DsReplicaObjectIdentifier *source_dsa_dn;
783 drsuapi_DsReplicaObjectIdentifier *transport_dn;
784 [charset(UTF16),string] uint16 *source_dsa_address;
785 uint8 schedule[84];
786 drsuapi_DsReplicaAddOptions options;
787 } drsuapi_DsReplicaAddRequest2;
789 typedef [switch_type(int32)] union {
790 [case(1)] drsuapi_DsReplicaAddRequest1 req1;
791 [case(2)] drsuapi_DsReplicaAddRequest2 req2;
792 } drsuapi_DsReplicaAddRequest;
794 WERROR drsuapi_DsReplicaAdd(
795 [in] policy_handle *bind_handle,
796 [in] int32 level,
797 [in,switch_is(level)] drsuapi_DsReplicaAddRequest req
801 /*****************/
802 /* Function 0x06 */
803 typedef bitmap {
804 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,
805 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002
806 /* TODO ... */
807 } drsuapi_DsReplicaDeleteOptions;
810 typedef struct {
811 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
812 [charset(UTF16),string] uint16 *source_dsa_address;
813 drsuapi_DsReplicaDeleteOptions options;
814 } drsuapi_DsReplicaDelRequest1;
816 typedef [switch_type(int32)] union {
817 [case(1)] drsuapi_DsReplicaDelRequest1 req1;
818 } drsuapi_DsReplicaDelRequest;
820 WERROR drsuapi_DsReplicaDel(
821 [in] policy_handle *bind_handle,
822 [in] int32 level,
823 [in,switch_is(level)] drsuapi_DsReplicaDelRequest req
826 /*****************/
827 /* Function 0x07 */
828 typedef bitmap {
829 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,
830 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002
831 /* TODO ... */
832 } drsuapi_DsReplicaModifyOptions;
835 typedef struct {
836 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
837 GUID source_dra;
838 [charset(UTF16),string] uint16 *source_dra_address;
839 uint8 schedule[84];
840 uint32 replica_flags;
841 uint32 modify_fields;
842 drsuapi_DsReplicaModifyOptions options;
843 } drsuapi_DsReplicaModRequest1;
845 typedef [switch_type(int32)] union {
846 [case(1)] drsuapi_DsReplicaModRequest1 req1;
847 } drsuapi_DsReplicaModRequest;
849 WERROR drsuapi_DsReplicaMod(
850 [in] policy_handle *bind_handle,
851 [in] int32 level,
852 [in,switch_is(level)] drsuapi_DsReplicaModRequest req
855 /*****************/
856 /* Function 0x08 */
857 [todo] WERROR DRSUAPI_VERIFY_NAMES();
859 /*****************/
860 /* Function 0x09 */
862 /* how are type 4 and 7 different from 2 and 3 ? */
863 typedef [v1_enum] enum {
864 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS = 1,
865 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS = 2,
866 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS = 3,
867 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 = 4,
868 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS = 5,
869 DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS = 6,
870 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2 = 7
871 } drsuapi_DsMembershipType;
873 typedef struct {
874 NTSTATUS status;
875 [range(0,10000)] uint32 num_memberships;
876 [range(0,10000)] uint32 num_sids;
877 [size_is(num_memberships)] drsuapi_DsReplicaObjectIdentifier **info_array;
878 [size_is(num_memberships)] samr_GroupAttrs *group_attrs;
879 [size_is(num_sids)] dom_sid28 **sids;
880 } drsuapi_DsGetMembershipsCtr1;
882 typedef [switch_type(int32)] union {
883 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
884 } drsuapi_DsGetMembershipsCtr;
886 const int DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR = 0x1;
888 typedef struct {
889 [range(1,10000)] uint32 count;
890 [size_is(count)] drsuapi_DsReplicaObjectIdentifier **info_array;
891 uint32 flags;
892 drsuapi_DsMembershipType type;
893 drsuapi_DsReplicaObjectIdentifier *domain;
894 } drsuapi_DsGetMembershipsRequest1;
896 typedef [switch_type(int32)] union {
897 [case(1)] drsuapi_DsGetMembershipsRequest1 req1;
898 } drsuapi_DsGetMembershipsRequest;
900 [todo] WERROR drsuapi_DsGetMemberships(
901 [in] policy_handle *bind_handle,
902 [in] int32 level,
903 [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req,
904 [out,ref] int32 *level_out,
905 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr
908 /*****************/
909 /* Function 0x0a */
910 [todo] WERROR DRSUAPI_INTER_DOMAIN_MOVE();
912 /*****************/
913 /* Function 0x0b */
914 typedef struct {
915 uint32 unknown1;
916 uint32 unknown2;
917 [range(0,0x00A00000)] uint32 length;
918 [size_is(length)] uint8 *data;
919 } drsuapi_DsGetNT4ChangeLogRequest1;
921 typedef [switch_type(uint32)] union {
922 [case(1)] drsuapi_DsGetNT4ChangeLogRequest1 req1;
923 } drsuapi_DsGetNT4ChangeLogRequest;
925 typedef struct {
926 [range(0,0x00A00000)] uint32 length1;
927 [range(0,0x00A00000)] uint32 length2;
928 hyper unknown1;
929 NTTIME time2;
930 hyper unknown3;
931 NTTIME time4;
932 hyper unknown5;
933 NTTIME time6;
934 NTSTATUS status;
935 [size_is(length1)] uint8 *data1;
936 [size_is(length2)] uint8 *data2;
937 } drsuapi_DsGetNT4ChangeLogInfo1;
939 typedef [switch_type(uint32)] union {
940 [case(1)] drsuapi_DsGetNT4ChangeLogInfo1 info1;
941 } drsuapi_DsGetNT4ChangeLogInfo;
943 [todo] WERROR drsuapi_DsGetNT4ChangeLog(
944 [in] policy_handle *bind_handle,
945 [in] uint32 level,
946 [in,ref] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest *req,
947 [out,ref] uint32 *level_out,
948 [out,ref] [switch_is(*level_out)] drsuapi_DsGetNT4ChangeLogInfo *info
951 /*****************/
952 /* Function 0x0c */
953 typedef [v1_enum] enum {
954 DRSUAPI_DS_NAME_STATUS_OK = 0,
955 DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR = 1,
956 DRSUAPI_DS_NAME_STATUS_NOT_FOUND = 2,
957 DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE = 3,
958 DRSUAPI_DS_NAME_STATUS_NO_MAPPING = 4,
959 DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY = 5,
960 DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING = 6,
961 DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL = 7
962 } drsuapi_DsNameStatus;
964 typedef [v1_enum] enum {
965 DRSUAPI_DS_NAME_FLAG_NO_FLAGS = 0x0,
966 DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,
967 DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC = 0x2,
968 DRSUAPI_DS_NAME_FLAG_GCVERIFY = 0x4,
969 DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL = 0x8
970 } drsuapi_DsNameFlags;
972 typedef [v1_enum] enum {
973 DRSUAPI_DS_NAME_FORMAT_UNKNOWN = 0,
974 DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 1,
975 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 2,
976 DRSUAPI_DS_NAME_FORMAT_DISPLAY = 3,
977 DRSUAPI_DS_NAME_FORMAT_GUID = 6,
978 DRSUAPI_DS_NAME_FORMAT_CANONICAL = 7,
979 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 8,
980 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 9,
981 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 10,
982 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 11,
983 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 12
984 } drsuapi_DsNameFormat;
986 typedef struct {
987 [string,charset(UTF16)] uint16 *str;
988 } drsuapi_DsNameString;
990 typedef struct {
991 uint32 codepage; /* 0x000004e4 - 1252 is german codepage*/
992 uint32 language; /* 0x00000407 - german language ID*/
993 drsuapi_DsNameFlags format_flags;
994 drsuapi_DsNameFormat format_offered;
995 drsuapi_DsNameFormat format_desired;
996 [range(1,10000)] uint32 count;
997 [size_is(count)] drsuapi_DsNameString *names;
998 } drsuapi_DsNameRequest1;
1000 typedef [switch_type(int32)] union {
1001 [case(1)] drsuapi_DsNameRequest1 req1;
1002 } drsuapi_DsNameRequest;
1004 typedef struct {
1005 drsuapi_DsNameStatus status;
1006 [charset(UTF16),string] uint16 *dns_domain_name;
1007 [charset(UTF16),string] uint16 *result_name;
1008 } drsuapi_DsNameInfo1;
1010 typedef struct {
1011 uint32 count;
1012 [size_is(count)] drsuapi_DsNameInfo1 *array;
1013 } drsuapi_DsNameCtr1;
1015 typedef [switch_type(int32)] union {
1016 [case(1)] drsuapi_DsNameCtr1 *ctr1;
1017 } drsuapi_DsNameCtr;
1019 WERROR drsuapi_DsCrackNames(
1020 [in] policy_handle *bind_handle,
1021 [in] int32 level,
1022 [in,ref,switch_is(level)] drsuapi_DsNameRequest *req,
1023 [out,ref] int32 *level_out,
1024 [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr
1027 /*****************/
1028 /* Function 0x0d */
1029 typedef [v1_enum] enum {
1030 DRSUAPI_DS_SPN_OPERATION_ADD = 0,
1031 DRSUAPI_DS_SPN_OPERATION_REPLACE= 1,
1032 DRSUAPI_DS_SPN_OPERATION_DELETE = 2
1033 } drsuapi_DsSpnOperation;
1035 typedef struct {
1036 drsuapi_DsSpnOperation operation;
1037 uint32 unknown1;
1038 [charset(UTF16),string] uint16 *object_dn;
1039 [range(0,10000)] uint32 count;
1040 [size_is(count)] drsuapi_DsNameString *spn_names;
1041 } drsuapi_DsWriteAccountSpnRequest1;
1043 typedef [switch_type(int32)] union {
1044 [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1;
1045 } drsuapi_DsWriteAccountSpnRequest;
1047 typedef struct {
1048 WERROR status;
1049 } drsuapi_DsWriteAccountSpnResult1;
1051 typedef [switch_type(int32)] union {
1052 [case(1)] drsuapi_DsWriteAccountSpnResult1 res1;
1053 } drsuapi_DsWriteAccountSpnResult;
1055 WERROR drsuapi_DsWriteAccountSpn(
1056 [in] policy_handle *bind_handle,
1057 [in] int32 level,
1058 [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req,
1059 [out,ref] int32 *level_out,
1060 [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res
1063 /*****************/
1064 /* Function 0x0e */
1065 typedef struct {
1066 [charset(UTF16),string] uint16 *server_dn;
1067 [charset(UTF16),string] uint16 *domain_dn;
1068 boolean32 commit;
1069 } drsuapi_DsRemoveDSServerRequest1;
1071 typedef [switch_type(int32)] union {
1072 [case(1)] drsuapi_DsRemoveDSServerRequest1 req1;
1073 } drsuapi_DsRemoveDSServerRequest;
1075 typedef struct {
1076 boolean32 last_dc_in_domain;
1077 } drsuapi_DsRemoveDSServerResult1;
1079 typedef [switch_type(int32)] union {
1080 [case(1)] drsuapi_DsRemoveDSServerResult1 res1;
1081 } drsuapi_DsRemoveDSServerResult;
1083 WERROR drsuapi_DsRemoveDSServer(
1084 [in] policy_handle *bind_handle,
1085 [in] int32 level,
1086 [in,ref,switch_is(level)] drsuapi_DsRemoveDSServerRequest *req,
1087 [out,ref] int32 *level_out,
1088 [out,ref,switch_is(*level_out)] drsuapi_DsRemoveDSServerResult *res
1091 /*****************/
1092 /* Function 0x0f */
1093 [todo] WERROR DRSUAPI_REMOVE_DS_DOMAIN();
1095 /*****************/
1096 /* Function 0x10 */
1097 typedef struct {
1098 [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */
1099 int32 level; /* specifies the switch level for the request */
1100 } drsuapi_DsGetDCInfoRequest1;
1102 typedef [switch_type(int32)] union {
1103 [case(1)] drsuapi_DsGetDCInfoRequest1 req1;
1104 } drsuapi_DsGetDCInfoRequest;
1106 typedef struct {
1107 [charset(UTF16),string] uint16 *netbios_name;
1108 [charset(UTF16),string] uint16 *dns_name;
1109 [charset(UTF16),string] uint16 *site_name;
1110 [charset(UTF16),string] uint16 *computer_dn;
1111 [charset(UTF16),string] uint16 *server_dn;
1112 uint32 is_pdc;
1113 uint32 is_enabled;
1114 } drsuapi_DsGetDCInfo1;
1116 typedef struct {
1117 [range(0,10000)] uint32 count;
1118 [size_is(count)] drsuapi_DsGetDCInfo1 *array;
1119 } drsuapi_DsGetDCInfoCtr1;
1121 typedef struct {
1122 [charset(UTF16),string] uint16 *netbios_name;
1123 [charset(UTF16),string] uint16 *dns_name;
1124 [charset(UTF16),string] uint16 *site_name;
1125 [charset(UTF16),string] uint16 *site_dn;
1126 [charset(UTF16),string] uint16 *computer_dn;
1127 [charset(UTF16),string] uint16 *server_dn;
1128 [charset(UTF16),string] uint16 *ntds_dn;
1129 uint32 is_pdc;
1130 uint32 is_enabled;
1131 uint32 is_gc;
1132 GUID site_guid;
1133 GUID computer_guid;
1134 GUID server_guid;
1135 GUID ntds_guid;
1136 } drsuapi_DsGetDCInfo2;
1138 typedef struct {
1139 [range(0,10000)] uint32 count;
1140 [size_is(count)] drsuapi_DsGetDCInfo2 *array;
1141 } drsuapi_DsGetDCInfoCtr2;
1143 typedef struct {
1144 [charset(UTF16),string] uint16 *netbios_name;
1145 [charset(UTF16),string] uint16 *dns_name;
1146 [charset(UTF16),string] uint16 *site_name;
1147 [charset(UTF16),string] uint16 *site_dn;
1148 [charset(UTF16),string] uint16 *computer_dn;
1149 [charset(UTF16),string] uint16 *server_dn;
1150 [charset(UTF16),string] uint16 *ntds_dn;
1151 uint32 is_pdc;
1152 uint32 is_enabled;
1153 uint32 is_gc;
1154 uint32 is_rodc;
1155 GUID site_guid;
1156 GUID computer_guid;
1157 GUID server_guid;
1158 GUID ntds_guid;
1159 } drsuapi_DsGetDCInfo3;
1161 typedef struct {
1162 [range(0,10000)] uint32 count;
1163 [size_is(count)] drsuapi_DsGetDCInfo3 *array;
1164 } drsuapi_DsGetDCInfoCtr3;
1167 * this represents an active connection to the
1168 * Directory System Agent (DSA)
1169 * this can be via LDAP or DRSUAPI
1171 typedef struct {
1172 [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
1173 uint32 unknown2;
1174 uint32 connection_time; /* in seconds */
1175 uint32 unknown4;
1176 uint32 unknown5;
1177 uint32 unknown6;
1179 * client_account can be the following:
1180 * "W2K3\Administrator"
1181 * "Administrator@W2K3"
1182 * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base"
1183 * ""
1184 * or NULL
1186 [charset(UTF16),string] uint16 *client_account;
1187 } drsuapi_DsGetDCConnection01;
1189 typedef struct {
1190 [range(0,10000)] uint32 count;
1191 [size_is(count)] drsuapi_DsGetDCConnection01 *array;
1192 } drsuapi_DsGetDCConnectionCtr01;
1194 typedef [v1_enum] enum {
1195 DRSUAPI_DC_INFO_CTR_1 = 1,
1196 DRSUAPI_DC_INFO_CTR_2 = 2,
1197 DRSUAPI_DC_INFO_CTR_3 = 3,
1198 DRSUAPI_DC_CONNECTION_CTR_01 = -1
1199 } drsuapi_DsGetDCInfoCtrLevels;
1201 typedef [switch_type(int32)] union {
1202 [case(DRSUAPI_DC_INFO_CTR_1)] drsuapi_DsGetDCInfoCtr1 ctr1;
1203 [case(DRSUAPI_DC_INFO_CTR_2)] drsuapi_DsGetDCInfoCtr2 ctr2;
1204 [case(DRSUAPI_DC_INFO_CTR_3)] drsuapi_DsGetDCInfoCtr3 ctr3;
1205 [case(DRSUAPI_DC_CONNECTION_CTR_01)] drsuapi_DsGetDCConnectionCtr01 ctr01;
1206 } drsuapi_DsGetDCInfoCtr;
1208 WERROR drsuapi_DsGetDomainControllerInfo(
1209 [in] policy_handle *bind_handle,
1210 [in] int32 level,
1211 [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req,
1212 [out,ref] int32 *level_out,
1213 [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr
1216 /*****************/
1217 /* Function 0x11 */
1218 typedef [public,noprint] struct {
1219 drsuapi_DsReplicaObjectListItem *next_object;
1220 drsuapi_DsReplicaObject object;
1221 } drsuapi_DsReplicaObjectListItem;
1224 * The DsAddEntry() call which creates a nTDSDSA object,
1225 * also adds a servicePrincipalName in the following form
1226 * to the computer account of the new domain controller
1227 * referenced by the "serverReferenece" attribute.
1229 * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name>
1231 * also note that the "serverReference" isn't added to the new object!
1233 const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID = "E3514235-4B06-11D1-AB04-00C04FC2DCD2";
1236 * please note the the current idl
1237 * for DsAddEntry does only parse
1238 * what I saw between 2 w2k3 boxes
1239 * in my dssync experiments I got some other replies
1240 * so all I want to say is that this is very incomplete yet...
1241 * --metze
1243 typedef struct {
1244 drsuapi_DsReplicaObjectListItem first_object;
1245 } drsuapi_DsAddEntryRequest2;
1247 typedef [switch_type(int32)] union {
1248 [case(2)] drsuapi_DsAddEntryRequest2 req2;
1249 } drsuapi_DsAddEntryRequest;
1251 typedef struct {
1252 uint32 unknown1;
1253 WERROR status;
1254 uint32 unknown2;
1255 uint16 unknown3;
1256 } drsuapi_DsAddEntryErrorInfoX;
1258 typedef struct {
1259 [range(0,10485760)] uint32 size;
1260 [size_is(size)] uint8 *data;
1261 } drsuapi_DsAddEntryExtraErrorBuffer;
1263 typedef struct {
1264 drsuapi_DsAddEntryErrorInfoX error;
1265 drsuapi_DsAttributeId attid;
1266 uint32 unknown2;
1267 drsuapi_DsAddEntryExtraErrorBuffer buffer;
1268 } drsuapi_DsAddEntryExtraError1;
1270 typedef /*[noprint]*/ struct {
1271 drsuapi_DsAddEntryErrorListItem1 *next;
1272 drsuapi_DsAddEntryExtraError1 error;
1273 } drsuapi_DsAddEntryErrorListItem1;
1275 typedef struct {
1276 drsuapi_DsReplicaObjectIdentifier *id;
1277 WERROR status;
1278 drsuapi_DsAddEntryErrorListItem1 first;
1279 } drsuapi_DsAddEntryErrorInfo1;
1281 typedef [switch_type(uint32)] union {
1282 [case(1)] drsuapi_DsAddEntryErrorInfo1 error1;
1283 /* [case(2)] drsuapi_DsAddEntryErrorInfo2 error2;
1284 [case(3)] drsuapi_DsAddEntryErrorInfo3 error3;
1285 */ [case(4)] drsuapi_DsAddEntryErrorInfoX errorX;
1286 [case(5)] drsuapi_DsAddEntryErrorInfoX errorX;
1287 [case(6)] drsuapi_DsAddEntryErrorInfoX errorX;
1288 [case(7)] drsuapi_DsAddEntryErrorInfoX errorX;
1289 } drsuapi_DsAddEntryErrorInfo;
1291 typedef struct {
1292 WERROR status;
1293 uint32 level;
1294 [switch_is(level)] drsuapi_DsAddEntryErrorInfo *info;
1295 } drsuapi_DsAddEntryError1;
1297 typedef [switch_type(uint32)] union {
1298 [case(1)] drsuapi_DsAddEntryError1 info1;
1299 } drsuapi_DsAddEntryError;
1301 typedef struct {
1302 GUID guid;
1303 dom_sid28 sid;
1304 } drsuapi_DsReplicaObjectIdentifier2;
1306 typedef struct {
1307 drsuapi_DsReplicaObjectIdentifier *id;
1308 uint32 unknown1;
1309 drsuapi_DsAddEntryErrorInfoX error;
1310 [range(0,10000)] uint32 count;
1311 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
1312 } drsuapi_DsAddEntryCtr2;
1314 typedef struct {
1315 drsuapi_DsReplicaObjectIdentifier *id;
1316 uint32 level;
1317 [switch_is(level)] drsuapi_DsAddEntryError *error;
1318 [range(0,10000)] uint32 count;
1319 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
1320 } drsuapi_DsAddEntryCtr3;
1322 typedef [switch_type(int32)] union {
1323 [case(2)] drsuapi_DsAddEntryCtr2 ctr2;
1324 [case(3)] drsuapi_DsAddEntryCtr3 ctr3;
1325 } drsuapi_DsAddEntryCtr;
1327 [public] WERROR drsuapi_DsAddEntry(
1328 [in] policy_handle *bind_handle,
1329 [in] int32 level,
1330 [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req,
1331 [out,ref] int32 *level_out,
1332 [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr
1335 /*****************/
1336 /* Function 0x12 */
1337 typedef bitmap {
1338 DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION = 0x00000001,
1339 DRSUAPI_DS_EXECUTE_KCC_DAMPED = 0x00000002
1340 } drsuapi_DsExecuteKCCFlags;
1342 typedef struct {
1343 uint32 taskID;
1344 drsuapi_DsExecuteKCCFlags flags;
1345 } drsuapi_DsExecuteKCC1;
1347 typedef [switch_type(uint32)] union {
1348 [case(1)] drsuapi_DsExecuteKCC1 ctr1;
1349 } drsuapi_DsExecuteKCCRequest;
1351 WERROR drsuapi_DsExecuteKCC(
1352 [in] policy_handle *bind_handle,
1353 [in] uint32 level,
1354 [in, ref, switch_is(level)] drsuapi_DsExecuteKCCRequest *req
1357 /*****************/
1358 /* Function 0x13 */
1359 typedef [v1_enum] enum {
1360 DRSUAPI_DS_REPLICA_GET_INFO = 1,
1361 DRSUAPI_DS_REPLICA_GET_INFO2 = 2
1362 } drsuapi_DsReplicaGetInfoLevel;
1364 typedef [v1_enum] enum {
1365 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS = 0,
1366 DRSUAPI_DS_REPLICA_INFO_CURSORS = 1,
1367 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA = 2,
1368 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES = 3,
1369 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES = 4,
1370 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS = 5,
1371 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA = 6,
1372 DRSUAPI_DS_REPLICA_INFO_CURSORS2 = 7,
1373 DRSUAPI_DS_REPLICA_INFO_CURSORS3 = 8,
1374 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 = 9,
1375 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 = 10,
1376 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02 = -2,
1377 DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04 = -4,
1378 DRSUAPI_DS_REPLICA_INFO_CURSORS05 = -5,
1379 DRSUAPI_DS_REPLICA_INFO_06 = -6
1380 } drsuapi_DsReplicaInfoType;
1382 typedef struct {
1383 drsuapi_DsReplicaInfoType info_type;
1384 [charset(UTF16),string] uint16 *object_dn;
1385 GUID guid1;
1386 } drsuapi_DsReplicaGetInfoRequest1;
1388 typedef struct {
1389 drsuapi_DsReplicaInfoType info_type;
1390 [charset(UTF16),string] uint16 *object_dn;
1391 GUID guid1;
1392 uint32 unknown1;
1393 [charset(UTF16),string] uint16 *string1;
1394 [charset(UTF16),string] uint16 *string2;
1395 uint32 unknown2;
1396 } drsuapi_DsReplicaGetInfoRequest2;
1398 typedef [switch_type(drsuapi_DsReplicaGetInfoLevel)] union {
1399 [case(DRSUAPI_DS_REPLICA_GET_INFO)] drsuapi_DsReplicaGetInfoRequest1 req1;
1400 [case(DRSUAPI_DS_REPLICA_GET_INFO2)] drsuapi_DsReplicaGetInfoRequest2 req2;
1401 } drsuapi_DsReplicaGetInfoRequest;
1403 typedef struct {
1404 [charset(UTF16),string] uint16 *naming_context_dn;
1405 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
1406 [charset(UTF16),string] uint16 *source_dsa_address;
1407 [charset(UTF16),string] uint16 *transport_obj_dn;
1408 drsuapi_DsReplicaNeighbourFlags replica_flags;
1409 uint32 reserved;
1410 GUID naming_context_obj_guid;
1411 GUID source_dsa_obj_guid;
1412 GUID source_dsa_invocation_id;
1413 GUID transport_obj_guid;
1414 hyper tmp_highest_usn;
1415 hyper highest_usn;
1416 NTTIME last_success;
1417 NTTIME last_attempt;
1418 WERROR result_last_attempt;
1419 uint32 consecutive_sync_failures;
1420 } drsuapi_DsReplicaNeighbour;
1422 typedef struct {
1423 uint32 count;
1424 uint32 reserved;
1425 [size_is(count)] drsuapi_DsReplicaNeighbour array[];
1426 } drsuapi_DsReplicaNeighbourCtr;
1428 typedef struct {
1429 uint32 count;
1430 uint32 reserved;
1431 [size_is(count)] drsuapi_DsReplicaCursor array[];
1432 } drsuapi_DsReplicaCursorCtr;
1434 typedef struct {
1435 [charset(UTF16),string] uint16 *attribute_name;
1436 uint32 version;
1437 NTTIME originating_change_time;
1438 GUID originating_invocation_id;
1439 hyper originating_usn;
1440 hyper local_usn;
1441 } drsuapi_DsReplicaObjMetaData;
1443 typedef struct {
1444 uint32 count;
1445 uint32 reserved;
1446 [size_is(count)] drsuapi_DsReplicaObjMetaData array[];
1447 } drsuapi_DsReplicaObjMetaDataCtr;
1449 typedef struct {
1450 [charset(UTF16),string] uint16 *dsa_obj_dn;
1451 GUID dsa_obj_guid;
1452 NTTIME first_failure;
1453 uint32 num_failures;
1454 WERROR last_result;
1455 } drsuapi_DsReplicaKccDsaFailure;
1457 typedef struct {
1458 uint32 count;
1459 uint32 reserved;
1460 [size_is(count)] drsuapi_DsReplicaKccDsaFailure array[];
1461 } drsuapi_DsReplicaKccDsaFailuresCtr;
1463 typedef enum {
1464 DRSUAPI_DS_REPLICA_OP_TYPE_SYNC = 0,
1465 DRSUAPI_DS_REPLICA_OP_TYPE_ADD = 1,
1466 DRSUAPI_DS_REPLICA_OP_TYPE_DELETE = 2,
1467 DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY = 3,
1468 DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS = 4
1469 } drsuapi_DsReplicaOpType;
1471 typedef [switch_type(drsuapi_DsReplicaOpType)] union {
1472 [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] drsuapi_DsReplicaSyncOptions sync;
1473 [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] drsuapi_DsReplicaAddOptions add;
1474 [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions op_delete;
1475 [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] drsuapi_DsReplicaModifyOptions modify;
1476 [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] drsuapi_DsReplicaUpdateRefsOptions update_refs;
1477 [default] uint32 unknown;
1478 } drsuapi_DsRplicaOpOptions;
1480 typedef struct {
1481 NTTIME operation_start;
1482 uint32 serial_num; /* unique till reboot */
1483 uint32 priority;
1484 drsuapi_DsReplicaOpType operation_type;
1485 [switch_is(operation_type)] drsuapi_DsRplicaOpOptions options;
1486 [charset(UTF16),string] uint16 *nc_dn;
1487 [charset(UTF16),string] uint16 *remote_dsa_obj_dn;
1488 [charset(UTF16),string] uint16 *remote_dsa_address;
1489 GUID nc_obj_guid;
1490 GUID remote_dsa_obj_guid;
1491 } drsuapi_DsReplicaOp;
1493 typedef struct {
1494 NTTIME time;
1495 uint32 count;
1496 [size_is(count)] drsuapi_DsReplicaOp array[];
1497 } drsuapi_DsReplicaOpCtr;
1499 typedef struct {
1500 [charset(UTF16),string] uint16 *attribute_name;
1501 [charset(UTF16),string] uint16 *object_dn;
1502 [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
1503 DATA_BLOB *binary;
1504 NTTIME deleted;
1505 NTTIME created;
1506 uint32 version;
1507 NTTIME originating_change_time;
1508 GUID originating_invocation_id;
1509 hyper originating_usn;
1510 hyper local_usn;
1511 } drsuapi_DsReplicaAttrValMetaData;
1513 typedef struct {
1514 uint32 count;
1515 int32 enumeration_context;
1516 [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[];
1517 } drsuapi_DsReplicaAttrValMetaDataCtr;
1519 typedef struct {
1520 uint32 count;
1521 int32 enumeration_context;
1522 [size_is(count)] drsuapi_DsReplicaCursor2 array[];
1523 } drsuapi_DsReplicaCursor2Ctr;
1525 typedef struct {
1526 GUID source_dsa_invocation_id;
1527 hyper highest_usn;
1528 NTTIME last_sync_success;
1529 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
1530 } drsuapi_DsReplicaCursor3;
1532 typedef struct {
1533 uint32 count;
1534 int32 enumeration_context;
1535 [size_is(count)] drsuapi_DsReplicaCursor3 array[];
1536 } drsuapi_DsReplicaCursor3Ctr;
1538 typedef struct {
1539 [charset(UTF16),string] uint16 *attribute_name;
1540 uint32 version;
1541 NTTIME originating_change_time;
1542 GUID originating_invocation_id;
1543 hyper originating_usn;
1544 hyper local_usn;
1545 [charset(UTF16),string] uint16 *originating_dsa_dn;
1546 } drsuapi_DsReplicaObjMetaData2;
1548 typedef struct {
1549 uint32 count;
1550 int32 enumeration_context;
1551 [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[];
1552 } drsuapi_DsReplicaObjMetaData2Ctr;
1554 typedef struct {
1555 [charset(UTF16),string] uint16 *attribute_name;
1556 [charset(UTF16),string] uint16 *object_dn;
1557 [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
1558 DATA_BLOB *binary;
1559 NTTIME deleted;
1560 NTTIME created;
1561 uint32 version;
1562 NTTIME originating_change_time;
1563 GUID originating_invocation_id;
1564 hyper originating_usn;
1565 hyper local_usn;
1566 [charset(UTF16),string] uint16 *originating_dsa_dn;
1567 } drsuapi_DsReplicaAttrValMetaData2;
1569 typedef struct {
1570 uint32 count;
1571 int32 enumeration_context;
1572 [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[];
1573 } drsuapi_DsReplicaAttrValMetaData2Ctr;
1575 typedef struct {
1576 hyper u1; /* session number? */
1577 uint32 u2;
1578 uint32 u3;
1579 GUID bind_guid;
1580 NTTIME_1sec bind_time;
1581 [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
1582 uint32 u5; /* this is the same value the client used as pid in the DsBindInfoX struct */
1583 } drsuapi_DsReplicaConnection04;
1585 typedef struct {
1586 [range(0,10000)] uint32 count;
1587 uint32 reserved;
1588 [size_is(count)] drsuapi_DsReplicaConnection04 array[];
1589 } drsuapi_DsReplicaConnection04Ctr;
1591 typedef struct {
1592 [charset(UTF16),string] uint16 *str1;
1593 uint32 u1;
1594 uint32 u2;
1595 uint32 u3;
1596 uint32 u4;
1597 uint32 u5;
1598 hyper u6;
1599 uint32 u7;
1600 } drsuapi_DsReplica06;
1602 typedef struct {
1603 [range(0,256)] uint32 count;
1604 uint32 reserved;
1605 [size_is(count)] drsuapi_DsReplica06 array[];
1606 } drsuapi_DsReplica06Ctr;
1608 typedef [switch_type(drsuapi_DsReplicaInfoType)] union {
1609 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] drsuapi_DsReplicaNeighbourCtr *neighbours;
1610 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] drsuapi_DsReplicaCursorCtr *cursors;
1611 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] drsuapi_DsReplicaObjMetaDataCtr *objmetadata;
1612 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;
1613 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;
1614 [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] drsuapi_DsReplicaOpCtr *pendingops;
1615 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;
1616 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] drsuapi_DsReplicaCursor2Ctr *cursors2;
1617 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] drsuapi_DsReplicaCursor3Ctr *cursors3;
1618 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;
1619 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;
1620 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02)] drsuapi_DsReplicaNeighbourCtr *neighbours02;
1621 [case(DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04)] drsuapi_DsReplicaConnection04Ctr *connections04;
1622 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS05)] drsuapi_DsReplicaCursorCtrEx *cursors05;
1623 [case(DRSUAPI_DS_REPLICA_INFO_06)] drsuapi_DsReplica06Ctr *i06;
1624 } drsuapi_DsReplicaInfo;
1626 WERROR drsuapi_DsReplicaGetInfo(
1627 [in] policy_handle *bind_handle,
1628 [in] drsuapi_DsReplicaGetInfoLevel level,
1629 [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req,
1630 [out,ref] drsuapi_DsReplicaInfoType *info_type,
1631 [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info
1634 /*****************/
1635 /* Function 0x14 */
1636 [todo] WERROR DRSUAPI_ADD_SID_HISTORY();
1638 /*****************/
1639 /* Function 0x15 */
1641 typedef struct {
1642 [range(0,10000)] uint32 num_entries;
1643 [size_is(num_entries)] drsuapi_DsGetMembershipsCtr1 **ctrl_array;
1644 } drsuapi_DsGetMemberships2Ctr1;
1646 typedef [switch_type(int32)] union {
1647 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
1648 } drsuapi_DsGetMemberships2Ctr;
1650 typedef struct {
1651 [range(1,10000)] uint32 num_req;
1652 [size_is(num_req)] drsuapi_DsGetMembershipsRequest1 **req_array;
1653 } drsuapi_DsGetMemberships2Request1;
1655 typedef [switch_type(int32)] union {
1656 [case(1)] drsuapi_DsGetMemberships2Request1 req1;
1657 } drsuapi_DsGetMemberships2Request;
1659 WERROR drsuapi_DsGetMemberships2(
1660 [in] policy_handle *bind_handle,
1661 [in] int32 level,
1662 [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req,
1663 [out,ref] int32 *level_out,
1664 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr
1667 /*****************/
1668 /* Function 0x16 */
1669 [todo] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS();
1671 /*****************/
1672 /* Function 0x17 */
1673 [todo] WERROR DRSUAPI_GET_OBJECT_EXISTENCE();
1675 /*****************/
1676 /* Function 0x18 */
1677 typedef struct {
1678 WERROR error_code;
1679 uint32 site_cost;
1680 } drsuapi_DsSiteCostInfo;
1682 typedef struct {
1683 [range(0,10000)] uint32 num_info;
1684 [size_is(num_info)] drsuapi_DsSiteCostInfo *info;
1685 uint32 unknown;
1686 } drsuapi_QuerySitesByCostCtr1;
1688 typedef [switch_type(int32)] union {
1689 [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1;
1690 } drsuapi_QuerySitesByCostCtr;
1692 typedef struct {
1693 [charset(UTF16),string] uint16 *site_from;
1694 [range(1,10000)] uint32 num_req;
1695 [size_is(num_req)] [charset(UTF16),string] uint16 **site_to;
1696 uint32 flags;
1697 } drsuapi_QuerySitesByCostRequest1;
1699 typedef [switch_type(int32)] union {
1700 [case(1)] drsuapi_QuerySitesByCostRequest1 req1;
1701 } drsuapi_QuerySitesByCostRequest;
1703 WERROR drsuapi_QuerySitesByCost(
1704 [in] policy_handle *bind_handle,
1705 [in] int32 level,
1706 [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req,
1707 [out,ref] int32 *level_out,
1708 [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr