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