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