3 import
"security.idl", "misc.idl", "lsa.idl", "samr.idl";
6 uuid("e3514235-4b06-11d1-ab04-00c04fc2dcd2"),
8 endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]", "ncacn_ip_tcp:", "ncalrpc:"),
10 helpstring("Active Directory Replication"),
11 helper
("../librpc/ndr/ndr_drsuapi.h"),
12 pointer_default(unique)
16 typedef bitmap security_GroupAttrs security_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
61 typedef [public,bitmap32bit
] bitmap
{
62 DRSUAPI_DRS_GET_TGT
= 0x00000001
63 } drsuapi_DrsMoreOptions
;
65 /* see DRS_MSG_REPMOD_V1 */
66 typedef [public,bitmap32bit
] bitmap
{
67 DRSUAPI_DRS_UPDATE_FLAGS
= 0x00000001,
68 DRSUAPI_DRS_UPDATE_ADDRESS
= 0x00000002,
69 DRSUAPI_DRS_UPDATE_SCHEDULE
= 0x00000004
73 /* Function 0x00 drsuapi_DsBind() */
75 /* MS-DRSR 5.39 DRS_EXTENSIONS_INT */
76 typedef [bitmap32bit
] bitmap
{
77 DRSUAPI_SUPPORTED_EXTENSION_BASE
= 0x00000001,
78 DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION
= 0x00000002,
79 DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI
= 0x00000004,
80 DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2
= 0x00000008,
81 DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS
= 0x00000010,
82 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1
= 0x00000020,
83 DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION
= 0x00000040,
84 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY
= 0x00000080,
85 DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE
= 0x00000100,
86 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2
= 0x00000200,
87 DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION
= 0x00000400,
88 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2
= 0x00000800,
89 DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD
= 0x00001000,
90 DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND
= 0x00002000,
91 DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO
= 0x00004000,
92 DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION
= 0x00008000,
93 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01
= 0x00010000,
94 DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP
= 0x00020000,
95 DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY
= 0x00040000,
96 DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3
= 0x00080000,
97 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V5
= 0x00100000,
98 DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2
= 0x00200000,
99 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6
= 0x00400000,
100 DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS
= 0x00800000,
101 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8
= 0x01000000,
102 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5
= 0x02000000,
103 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6
= 0x04000000,
105 * the following 3 have the same value
106 * repadmin.exe /bind says that
108 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3
= 0x08000000,
109 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7
= 0x08000000,
110 DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT
= 0x08000000,
111 DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS
= 0x10000000,
112 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10
= 0x20000000,
113 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART2
= 0x40000000,
114 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART3
= 0x80000000
115 } drsuapi_SupportedExtensions
;
117 typedef [bitmap32bit
] bitmap
{
118 DRSUAPI_SUPPORTED_EXTENSION_ADAM
= 0x00000001,
119 DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2
= 0x00000002,
120 DRSUAPI_SUPPORTED_EXTENSION_RECYCLE_BIN
= 0x00000004
121 } drsuapi_SupportedExtensionsExt
;
123 /* this is used by w2k */
124 typedef [public] struct {
125 drsuapi_SupportedExtensions supported_extensions
;
128 } drsuapi_DsBindInfo24
;
130 /* this is used by w2k3 */
131 typedef [public] struct {
132 drsuapi_SupportedExtensions supported_extensions
;
136 } drsuapi_DsBindInfo28
;
138 typedef [public] struct {
139 drsuapi_SupportedExtensions supported_extensions
;
143 drsuapi_SupportedExtensionsExt supported_extensions_ext
;
144 } drsuapi_DsBindInfo32
;
146 /* this is used by w2k8 */
147 typedef [public] struct {
148 drsuapi_SupportedExtensions supported_extensions
;
152 drsuapi_SupportedExtensionsExt supported_extensions_ext
;
154 } drsuapi_DsBindInfo48
;
156 /* this is used by w2k12 R2 [MS-DRSR] Section 5.39 */
157 typedef [public] struct {
158 drsuapi_SupportedExtensions supported_extensions
;
162 drsuapi_SupportedExtensionsExt supported_extensions_ext
;
164 drsuapi_SupportedExtensionsExt supported_capabilities_ext
;
165 } drsuapi_DsBindInfo52
;
167 typedef [public] struct {
168 [flag
(NDR_REMAINING
)] DATA_BLOB info
;
169 } drsuapi_DsBindInfoFallBack
;
171 typedef [nopull
, nopush
, noprint
] [nodiscriminant
] union {
172 [case(24)][subcontext
(0), subcontext_size
(24)] drsuapi_DsBindInfo24 info24
;
173 [case(28)][subcontext
(0), subcontext_size
(28)] drsuapi_DsBindInfo28 info28
;
174 [case(32)][subcontext
(0), subcontext_size
(32)] drsuapi_DsBindInfo32 info32
;
175 [case(48)][subcontext
(0), subcontext_size
(48)] drsuapi_DsBindInfo48 info48
;
176 [case(52)][subcontext
(0), subcontext_size
(52)] drsuapi_DsBindInfo52 info52
;
178 * The size for the default case is a bit arbitrary it in fact the value
179 * of the switch but we can't reference it.
180 * As we hand(un-)marshall this structure it has 0 impact and makes
181 * pidl happy for wireshark too
183 [default][subcontext
(0), subcontext_size
(48)] drsuapi_DsBindInfoFallBack Fallback
;
184 } drsuapi_DsBindInfo
;
186 /* the drsuapi_DsBindInfoCtr was this before
187 * typedef [flag(NDR_PAHEX)] struct {
188 * [range(1,10000)] uint32 length;
189 * [size_is(length)] uint8 data[];
190 * } drsuapi_DsBindInfo;
192 * but we don't want the caller to manually decode this blob,
193 * so we're doing it here
197 * MS-DRSR.pdf gives the following definition
199 [range(1,10000)] DWORD cb;
200 [size_is(cb)] BYTE rgb[];
203 But we use a subcontext which has a slightly different signification on how
205 With the MS-DRSR definition we will have
206 size_is_cb cv rgb_array
207 with size_is_cb being a uint3264 and cv being a uint32
211 [range(1,10000)] uint32 length;
212 [switch_is(length)] drsuapi_DsBindInfo info;
213 } drsuapi_DsBindInfoCtr;
215 typedef [nodiscriminant] union {
216 [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24;
217 [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28;
218 [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48;
219 [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;
220 } drsuapi_DsBindInfo;
222 With this definition data is laid out this way:
223 length subcontext_size drsuapi_DsBindInfoxx
224 with length being a uint32 and subcontext_size being a uint3264
226 It has clearly an impact on the way things are aligned when using NDR64
228 typedef [flag
(NDR_NOALIGN
)] struct {
229 [range(1,10000)] uint3264 length
;
230 [value
(length
)] uint32 __ndr_length
;
231 [switch_is(length
)] drsuapi_DsBindInfo info
;
232 } drsuapi_DsBindInfoCtr
;
234 /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
236 * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
238 const char *DRSUAPI_DS_BIND_GUID
= "e24d201a-4fd6-11d1-a3da-0000f875ae0d";
240 * this magic guid are needed to fetch the whole tree with drsuapi_DsGetNCChanges()
241 * as administrator and this values are also used in the destination_dsa_guid field
242 * of drsuapi_DsGetNCChangesReq5/8 and the source_dsa_guid is zero.
244 const char *DRSUAPI_DS_BIND_GUID_W2K
= "6abec3d1-3054-41c8-a362-5a0c5b7d5d71";
245 const char *DRSUAPI_DS_BIND_GUID_W2K3
= "6afab99c-6e26-464a-975f-f58f105218bc";
247 [public] WERROR drsuapi_DsBind
(
248 [in,unique] GUID
*bind_guid
,
249 [in,out,unique] drsuapi_DsBindInfoCtr
*bind_info
,
250 [out] policy_handle
*bind_handle
255 WERROR drsuapi_DsUnbind
(
256 [in,out] policy_handle
*bind_handle
261 typedef [public,gensize
] struct {
262 [value
(ndr_size_drsuapi_DsReplicaObjectIdentifier
(r
, ndr
->flags
)-4)] uint32 __ndr_size
;
263 [value
(ndr_size_dom_sid28
(&sid
, ndr
->flags
))] uint32 __ndr_size_sid
;
266 [value
(strlen_m
(dn
))] uint32 __ndr_size_dn
;
267 [charset
(UTF16
),size_is(__ndr_size_dn
+1)] uint16 dn
[];
268 } drsuapi_DsReplicaObjectIdentifier
;
271 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
272 GUID source_dsa_guid
;
273 [charset
(DOS
),string] char *source_dsa_dns
; /* Source DSA dns_name in <guid>._msdcs.<domain_dns> form */
274 drsuapi_DrsOptions options
;
275 } drsuapi_DsReplicaSyncRequest1
;
277 typedef [switch_type(uint32
)] union {
278 [case(1)] drsuapi_DsReplicaSyncRequest1 req1
;
279 } drsuapi_DsReplicaSyncRequest
;
281 WERROR drsuapi_DsReplicaSync
(
282 [in] policy_handle
*bind_handle
,
284 [in,switch_is(level
)] drsuapi_DsReplicaSyncRequest
*req
289 typedef [public] struct {
290 hyper tmp_highest_usn
; /* updated after each object update */
292 hyper highest_usn
; /* updated after a full replication cycle */
293 } drsuapi_DsReplicaHighWaterMark
;
295 typedef [public] struct {
296 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
297 hyper highest_usn
; /* updated after a full replication cycle */
298 } drsuapi_DsReplicaCursor
;
301 [value
(1)] uint32
version;
302 [value
(0)] uint32 reserved1
;
303 [range(0,0x100000)] uint32 count
;
304 [value
(0)] uint32 reserved2
;
305 [size_is(count
)] drsuapi_DsReplicaCursor cursors
[];
306 } drsuapi_DsReplicaCursorCtrEx
;
308 typedef [flag
(NDR_PAHEX
),v1_enum] enum {
309 DRSUAPI_EXOP_NONE
= 0x00000000,
310 DRSUAPI_EXOP_FSMO_REQ_ROLE
= 0x00000001,
311 DRSUAPI_EXOP_FSMO_RID_ALLOC
= 0x00000002,
312 DRSUAPI_EXOP_FSMO_RID_REQ_ROLE
= 0x00000003,
313 DRSUAPI_EXOP_FSMO_REQ_PDC
= 0x00000004,
314 DRSUAPI_EXOP_FSMO_ABANDON_ROLE
= 0x00000005,
315 DRSUAPI_EXOP_REPL_OBJ
= 0x00000006,
316 DRSUAPI_EXOP_REPL_SECRET
= 0x00000007
317 } drsuapi_DsExtendedOperation
;
319 typedef [flag
(NDR_PAHEX
),v1_enum] enum {
320 DRSUAPI_EXOP_ERR_NONE
= 0x00000000,
321 DRSUAPI_EXOP_ERR_SUCCESS
= 0x00000001,
322 DRSUAPI_EXOP_ERR_UNKNOWN_OP
= 0x00000002,
323 DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER
= 0x00000003,
324 DRSUAPI_EXOP_ERR_UPDATE_ERR
= 0x00000004,
325 DRSUAPI_EXOP_ERR_EXCEPTION
= 0x00000005,
326 DRSUAPI_EXOP_ERR_UNKNOWN_CALLER
= 0x00000006,
327 DRSUAPI_EXOP_ERR_RID_ALLOC
= 0x00000007,
328 DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED
= 0x00000008,
329 DRSUAPI_EXOP_ERR_FMSO_PENDING_OP
= 0x00000009,
330 DRSUAPI_EXOP_ERR_MISMATCH
= 0x0000000A,
331 DRSUAPI_EXOP_ERR_COULDNT_CONTACT
= 0x0000000B,
332 DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES
= 0x0000000C,
333 DRSUAPI_EXOP_ERR_DIR_ERROR
= 0x0000000D,
334 DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS
= 0x0000000E,
335 DRSUAPI_EXOP_ERR_ACCESS_DENIED
= 0x0000000F,
336 DRSUAPI_EXOP_ERR_PARAM_ERROR
= 0x00000010
337 } drsuapi_DsExtendedError
;
340 GUID destination_dsa_guid
;
341 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
342 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
343 drsuapi_DsReplicaHighWaterMark highwatermark
;
344 drsuapi_DsReplicaCursorCtrEx
*uptodateness_vector
;
345 drsuapi_DrsOptions replica_flags
;
346 uint32 max_object_count
; /* w2k3 uses min(133,max(100,max_object_count)) */
347 uint32 max_ndr_size
; /* w2k3 seems to ignore this */
348 drsuapi_DsExtendedOperation extended_op
;
350 } drsuapi_DsGetNCChangesRequest5
;
353 * In DRSUAPI all attributes with syntax 2.5.5.2
354 * are identified by uint32 values
356 * the following table shows the mapping used between the two representations
357 * e.g. - objectClass 'nTDSDSA' has governsID: 1.2.840.113556.1.5.7000.47
358 * and a UINT32-ID of '0x0017002F'.
359 * - so the OID 1.2.840.113556.1.5.7000.47 is split into a
360 * OID-prefix: 1.2.840.113556.1.5.7000
361 * and a value: 47 => 0x2F
362 * - the mapping table gives a UINT32-prefix: 0x00170000
363 * - and the UINT32-ID is 0x0017002F = 0x00170000 | 0x2F
365 * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr
366 * array. The following are the default mappings of w2k3
368 * OID-prefix => UINT32-Id prefix
370 * 2.5.4.* => 0x00000000 (standard attributes RFC2256 core.schema)
371 * 2.5.6.* => 0x00010000 (standard object classes RFC2256 core.schema)
372 * 1.2.840.113556.1.2.* => 0x00020000
373 * 1.2.840.113556.1.3.* => 0x00030000
374 * 2.5.5.* => 0x00080000 (attributeSyntax OID's)
375 * 1.2.840.113556.1.4.* => 0x00090000
376 * 1.2.840.113556.1.5.* => 0x000A0000
377 * 2.16.840.1.113730.3.* => 0x00140000
378 * 0.9.2342.19200300.100.1.* => 0x00150000
379 * 2.16.840.1.113730.3.1.* => 0x00160000
380 * 1.2.840.113556.1.5.7000.* => 0x00170000
381 * 2.5.21.* => 0x00180000 (attrs for SubSchema)
382 * 2.5.18.* => 0x00190000 (createTimeStamp,modifyTimeStamp, SubSchema)
383 * 2.5.20.* => 0x001A0000
384 * 1.3.6.1.4.1.1466.101.119.* => 0x001B0000 (dynamicObject, entryTTL)
385 * 2.16.840.1.113730.3.2.* => 0x001C0000
386 * 1.3.6.1.4.1.250.1.* => 0x001D0000
387 * 1.2.840.113549.1.9.* => 0x001E0000 (unstructuredAddress,unstructuredName)
388 * 0.9.2342.19200300.100.4.* => 0x001F0000
390 * Here's a list of used 'attributeSyntax' OID's
392 * 2.5.5.1 => Object(DS-DN) string
393 * struct drsuapi_DsObjectIdentifier3
395 * 2.5.5.2 => OID-string
396 * => all values are represented as uint32 values in drsuapi
397 * => governsID, attributeID and attributeSyntax returned as OID-Strings in LDAP
398 * => mayContain, mustContain and all other attributes with 2.5.5.2 syntax
399 * are returned as attribute names
401 * 2.5.5.4 => String(Teletex) case-insensitive string with teletex charset
403 * 2.5.5.5 => String(IA5) case-sensitive string
405 * 2.5.5.6 => String(Numeric)
406 * => eg. internationalISDNNumber
408 * 2.5.5.7 => Object(DN-Binary) B:<byte count>:<bytes>:<object DN>
409 * => e.g. wellKnownObjects
415 * 2.5.5.10 => DATA_BLOB
418 * 2.5.5.11 => LDAP timestring
421 * 2.5.5.12 => String(Unicode) case-insensitive string
422 * => 'standard strings'
424 * 2.5.5.13 => Object(Presentation-Address) string
425 * => used in objectClass applicationEntity
427 * 2.5.5.14 => Object(DN-String) S:<char count>:<string>:<object DN>
430 * 2.5.5.15 => ntSecurityDescriptor
434 * 2.5.5.17 => dom_sid
436 typedef [noprint
] struct {
437 [range(0,10000)] uint32 length
;
438 [size_is(length
)] uint8
*binary_oid
; /* partial-binary-OID encoded with asn1_write_partial_OID_String() */
439 } drsuapi_DsReplicaOID
;
443 drsuapi_DsReplicaOID oid
;
444 } drsuapi_DsReplicaOIDMapping
;
446 typedef [public] struct {
447 [range(0,0x100000)] uint32 num_mappings
;
448 [size_is(num_mappings
)] drsuapi_DsReplicaOIDMapping
*mappings
;
449 } drsuapi_DsReplicaOIDMapping_Ctr
;
451 typedef [flag
(NDR_PAHEX
),v1_enum] enum {
452 DRSUAPI_OBJECTCLASS_top
= 0x00010000,
453 DRSUAPI_OBJECTCLASS_classSchema
= 0x0003000d,
454 DRSUAPI_OBJECTCLASS_attributeSchema
= 0x0003000e
455 } drsuapi_DsObjectClassId
;
457 typedef [flag
(NDR_PAHEX
),v1_enum,public] enum {
458 DRSUAPI_ATTID_objectClass
= 0x00000000,
459 DRSUAPI_ATTID_cn
= 0x00000003,
460 DRSUAPI_ATTID_ou
= 0x0000000b,
461 DRSUAPI_ATTID_description
= 0x0000000d,
462 DRSUAPI_ATTID_member
= 0x0000001f,
463 DRSUAPI_ATTID_distinguishedName
= 0x00000031,
464 DRSUAPI_ATTID_instanceType
= 0x00020001,
465 DRSUAPI_ATTID_whenCreated
= 0x00020002,
466 DRSUAPI_ATTID_possSuperiors
= 0x00020008,
467 DRSUAPI_ATTID_displayName
= 0x0002000d,
468 DRSUAPI_ATTID_hasMasterNCs
= 0x0002000e,
469 DRSUAPI_ATTID_nCName
= 0x00020010,
470 DRSUAPI_ATTID_subClassOf
= 0x00020015,
471 DRSUAPI_ATTID_governsID
= 0x00020016,
472 DRSUAPI_ATTID_mustContain
= 0x00020018,
473 DRSUAPI_ATTID_mayContain
= 0x00020019,
474 DRSUAPI_ATTID_rDNAttId
= 0x0002001A,
475 DRSUAPI_ATTID_attributeID
= 0x0002001e,
476 DRSUAPI_ATTID_attributeSyntax
= 0x00020020,
477 DRSUAPI_ATTID_isSingleValued
= 0x00020021,
478 DRSUAPI_ATTID_rangeLower
= 0x00020022,
479 DRSUAPI_ATTID_rangeUpper
= 0x00020023,
480 DRSUAPI_ATTID_dMDLocation
= 0x00020024,
481 DRSUAPI_ATTID_isDeleted
= 0x00020030,
482 DRSUAPI_ATTID_objectVersion
= 0x0002004c,
483 DRSUAPI_ATTID_invocationId
= 0x00020073,
484 DRSUAPI_ATTID_showInAdvancedViewOnly
= 0x000200a9,
485 DRSUAPI_ATTID_adminDisplayName
= 0x000200c2,
486 DRSUAPI_ATTID_adminDescription
= 0x000200e2,
487 DRSUAPI_ATTID_oMSyntax
= 0x000200e7,
488 DRSUAPI_ATTID_ntSecurityDescriptor
= 0x00020119,
489 DRSUAPI_ATTID_searchFlags
= 0x0002014e,
490 DRSUAPI_ATTID_auxiliaryClass
= 0x0002015f,
491 DRSUAPI_ATTID_lDAPDisplayName
= 0x000201cc,
492 DRSUAPI_ATTID_name
= 0x00090001,
493 DRSUAPI_ATTID_objectGUID
= 0x00090002,
494 DRSUAPI_ATTID_replPropertyMetaData
= 0x00090003,
495 DRSUAPI_ATTID_userAccountControl
= 0x00090008,
496 DRSUAPI_ATTID_badPwdCount
= 0x0009000c,
497 DRSUAPI_ATTID_codePage
= 0x00090010,
498 DRSUAPI_ATTID_countryCode
= 0x00090019,
499 DRSUAPI_ATTID_currentValue
= 0x0009001b,
500 DRSUAPI_ATTID_homeDirectory
= 0x0009002c,
501 DRSUAPI_ATTID_homeDrive
= 0x0009002d,
502 DRSUAPI_ATTID_lastLogoff
= 0x00090033,
503 DRSUAPI_ATTID_lastLogon
= 0x00090034,
504 DRSUAPI_ATTID_dBCSPwd
= 0x00090037,/* lmPwdHash */
505 DRSUAPI_ATTID_scriptPath
= 0x0009003e,
506 DRSUAPI_ATTID_logonHours
= 0x00090040,
507 DRSUAPI_ATTID_userWorkstations
= 0x00090056,
508 DRSUAPI_ATTID_unicodePwd
= 0x0009005a,/* ntPwdHash */
509 DRSUAPI_ATTID_ntPwdHistory
= 0x0009005e,
510 DRSUAPI_ATTID_pwdLastSet
= 0x00090060,
511 DRSUAPI_ATTID_primaryGroupID
= 0x00090062,
512 DRSUAPI_ATTID_priorValue
= 0x00090064,
513 DRSUAPI_ATTID_supplementalCredentials
= 0x0009007d,
514 DRSUAPI_ATTID_trustAuthIncoming
= 0x00090081,
515 DRSUAPI_ATTID_trustDirection
= 0x00090084,
516 DRSUAPI_ATTID_trustPartner
= 0x00090085,
517 DRSUAPI_ATTID_trustPosixOffset
= 0x00090086,
518 DRSUAPI_ATTID_trustAuthOutgoing
= 0x00090087,
519 DRSUAPI_ATTID_trustType
= 0x00090088,
520 DRSUAPI_ATTID_userParameters
= 0x0009008a,
521 DRSUAPI_ATTID_profilePath
= 0x0009008b,
522 DRSUAPI_ATTID_operatorCount
= 0x00090090,
523 DRSUAPI_ATTID_objectSid
= 0x00090092,
524 DRSUAPI_ATTID_schemaIDGUID
= 0x00090094,
525 DRSUAPI_ATTID_adminCount
= 0x00090096,
526 DRSUAPI_ATTID_comment
= 0x0009009C,/* User-Comment */
527 DRSUAPI_ATTID_accountExpires
= 0x0009009f,
528 DRSUAPI_ATTID_lmPwdHistory
= 0x000900a0,
529 DRSUAPI_ATTID_logonCount
= 0x000900a9,
530 DRSUAPI_ATTID_systemPossSuperiors
= 0x000900c3,
531 DRSUAPI_ATTID_systemMayContain
= 0x000900c4,
532 DRSUAPI_ATTID_systemMustContain
= 0x000900c5,
533 DRSUAPI_ATTID_systemAuxiliaryClass
= 0x000900c6,
534 DRSUAPI_ATTID_sAMAccountName
= 0x000900dd,
535 DRSUAPI_ATTID_sAMAccountType
= 0x0009012e,
536 DRSUAPI_ATTID_options
= 0x00090133,
537 DRSUAPI_ATTID_fSMORoleOwner
= 0x00090171,
538 DRSUAPI_ATTID_systemFlags
= 0x00090177,
539 DRSUAPI_ATTID_trustAttributes
= 0x000901d6,
540 DRSUAPI_ATTID_trustParent
= 0x000901d7,
541 DRSUAPI_ATTID_flatName
= 0x000901ff,
542 DRSUAPI_ATTID_serverReference
= 0x00090203,
543 DRSUAPI_ATTID_serverReferenceBL
= 0x00090204,
544 DRSUAPI_ATTID_nonSecurityMember
= 0x00090212,
545 DRSUAPI_ATTID_initialAuthIncoming
= 0x0009021b,
546 DRSUAPI_ATTID_initialAuthOutgoing
= 0x0009021c,
547 DRSUAPI_ATTID_wellKnownObjects
= 0x0009026a,
548 DRSUAPI_ATTID_dNSHostName
= 0x0009026b,
549 DRSUAPI_ATTID_isMemberOfPartialAttributeSet
= 0x0009027f,
550 DRSUAPI_ATTID_managedBy
= 0x0009028d,
551 DRSUAPI_ATTID_userPrincipalName
= 0x00090290,
552 DRSUAPI_ATTID_groupType
= 0x000902ee,
553 DRSUAPI_ATTID_servicePrincipalName
= 0x00090303,
554 DRSUAPI_ATTID_lastKnownParent
= 0x0009030d,
555 DRSUAPI_ATTID_objectCategory
= 0x0009030e,
556 DRSUAPI_ATTID_gPLink
= 0x0009037b,
557 DRSUAPI_ATTID_transportAddressAttribute
= 0x0009037f,
558 DRSUAPI_ATTID_schemaInfo
= 0x0009054e,
559 DRSUAPI_ATTID_msDS_Behavior_Version
= 0x000905b3,
560 DRSUAPI_ATTID_msDS_TrustForestTrustInfo
= 0x000906a6,
561 DRSUAPI_ATTID_msDS_KeyVersionNumber
= 0x000906f6,
562 DRSUAPI_ATTID_msDS_NonMembers
= 0x00090701,
563 DRSUAPI_ATTID_msDS_MembersForAzRole
= 0x0009070e,
564 DRSUAPI_ATTID_msDS_HasDomainNCs
= 0x0009071c,
565 DRSUAPI_ATTID_msDS_hasMasterNCs
= 0x0009072c,
566 DRSUAPI_ATTID_msDS_NeverRevealGroup
= 0x00090786,
567 DRSUAPI_ATTID_msDS_RevealOnDemandGroup
= 0x00090788,
568 DRSUAPI_ATTID_msDS_SupportedEncryptionTypes
= 0x000907ab,
569 DRSUAPI_ATTID_msDS_HostServiceAccount
= 0x00090808,
570 DRSUAPI_ATTID_isRecycled
= 0x0009080a,
572 DRSUAPI_ATTID_INVALID
= 0xFFFFFFFF
573 } drsuapi_DsAttributeId
;
576 [value
(1)] uint32
version;
577 [value
(0)] uint32 reserved1
;
578 [range(1,0x100000)] uint32 num_attids
;
579 [size_is(num_attids
)] drsuapi_DsAttributeId attids
[];
580 } drsuapi_DsPartialAttributeSet
;
582 typedef [public] struct {
583 GUID destination_dsa_guid
;
584 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
585 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
586 drsuapi_DsReplicaHighWaterMark highwatermark
;
587 drsuapi_DsReplicaCursorCtrEx
*uptodateness_vector
;
588 drsuapi_DrsOptions replica_flags
;
589 uint32 max_object_count
; /* w2k3 uses min(133,max(100,max_object_count)) */
590 uint32 max_ndr_size
; /* w2k3 seems to ignore this */
591 drsuapi_DsExtendedOperation extended_op
;
593 drsuapi_DsPartialAttributeSet
*partial_attribute_set
;
594 drsuapi_DsPartialAttributeSet
*partial_attribute_set_ex
;
595 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr
;
596 } drsuapi_DsGetNCChangesRequest8
;
598 typedef [public] struct {
599 GUID destination_dsa_guid
;
600 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
601 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
602 drsuapi_DsReplicaHighWaterMark highwatermark
;
603 drsuapi_DsReplicaCursorCtrEx
*uptodateness_vector
;
604 drsuapi_DrsOptions replica_flags
;
605 uint32 max_object_count
; /* w2k3 uses min(133,max(100,max_object_count)) */
606 uint32 max_ndr_size
; /* w2k3 seems to ignore this */
607 drsuapi_DsExtendedOperation extended_op
;
609 drsuapi_DsPartialAttributeSet
*partial_attribute_set
;
610 drsuapi_DsPartialAttributeSet
*partial_attribute_set_ex
;
611 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr
;
612 drsuapi_DrsMoreOptions more_flags
;
613 } drsuapi_DsGetNCChangesRequest10
;
615 typedef [switch_type(uint32
)] union {
616 [case(5)] drsuapi_DsGetNCChangesRequest5 req5
;
617 [case(8)] drsuapi_DsGetNCChangesRequest8 req8
;
618 [case(10)] drsuapi_DsGetNCChangesRequest10 req10
;
619 } drsuapi_DsGetNCChangesRequest
;
621 typedef [public] struct {
622 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
623 hyper highest_usn
; /* updated after a full replication cycle */
624 NTTIME last_sync_success
;
625 } drsuapi_DsReplicaCursor2
;
628 [value
(2)] uint32
version;
629 [value
(0)] uint32 reserved1
;
630 [range(0,0x100000)] uint32 count
;
631 [value
(0)] uint32 reserved2
;
632 [size_is(count
)] drsuapi_DsReplicaCursor2 cursors
[];
633 } drsuapi_DsReplicaCursor2CtrEx
;
635 /* Generic DATA_BLOB values */
637 [range(0,26214400),value
(ndr_size_DATA_BLOB
(0,blob
,0))] uint32 __ndr_size
;
639 } drsuapi_DsAttributeValue
;
642 [range(0,10485760)] uint32 num_values
;
643 [size_is(num_values
)] drsuapi_DsAttributeValue
*values
;
644 } drsuapi_DsAttributeValueCtr
;
646 /* DN String values */
647 typedef [public,gensize
] struct {
648 [value
(ndr_size_drsuapi_DsReplicaObjectIdentifier3
(r
, ndr
->flags
))] uint32 __ndr_size
;
649 [value
(ndr_size_dom_sid28
(&sid
,ndr
->flags
))] uint32 __ndr_size_sid
;
652 [value
(strlen_m
(dn
))] uint32 __ndr_size_dn
;
653 [charset
(UTF16
)] uint16 dn
[__ndr_size_dn
+1];
654 } drsuapi_DsReplicaObjectIdentifier3
;
656 typedef [public] struct {
657 [value
(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary
(r
, ndr
->flags
))] uint32 __ndr_size
;
658 [value
(ndr_size_dom_sid28
(&sid
,ndr
->flags
))] uint32 __ndr_size_sid
;
661 [value
(strlen_m
(dn
))] uint32 __ndr_size_dn
;
662 [charset
(UTF16
)] uint16 dn
[__ndr_size_dn
+1];
663 [value
(binary.length
+ 4)] uint32 __ndr_size_binary
;
664 [flag
(NDR_REMAINING
)] DATA_BLOB binary
;
665 } drsuapi_DsReplicaObjectIdentifier3Binary
;
667 typedef [public,noprint
] struct {
668 drsuapi_DsAttributeId attid
;
669 drsuapi_DsAttributeValueCtr value_ctr
;
670 } drsuapi_DsReplicaAttribute
;
673 [range(0,1048576)] uint32 num_attributes
;
674 [size_is(num_attributes
)] drsuapi_DsReplicaAttribute
*attributes
;
675 } drsuapi_DsReplicaAttributeCtr
;
677 typedef [public] bitmap
{
678 DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER
= 0x00000001,
679 DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC
= 0x00000002,
680 DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY
= 0x00010000
681 } drsuapi_DsReplicaObjectFlags
;
683 typedef [public] struct {
684 drsuapi_DsReplicaObjectIdentifier
*identifier
;
685 drsuapi_DsReplicaObjectFlags flags
;
686 drsuapi_DsReplicaAttributeCtr attribute_ctr
;
687 } drsuapi_DsReplicaObject
;
691 NTTIME_1sec originating_change_time
;
692 GUID originating_invocation_id
;
693 hyper originating_usn
;
694 } drsuapi_DsReplicaMetaData
;
696 typedef [public] struct {
697 [range(0,1048576)] uint32 count
;
698 [size_is(count
)] drsuapi_DsReplicaMetaData meta_data
[];
699 } drsuapi_DsReplicaMetaDataCtr
;
701 typedef [public,noprint
] struct {
702 [max_recursion
(20000)]
703 drsuapi_DsReplicaObjectListItemEx
*next_object
;
704 drsuapi_DsReplicaObject
object;
705 boolean32 is_nc_prefix
;
706 GUID
*parent_object_guid
;
707 drsuapi_DsReplicaMetaDataCtr
*meta_data_ctr
;
708 } drsuapi_DsReplicaObjectListItemEx
;
710 typedef [public,gensize
] struct {
711 GUID source_dsa_guid
; /* the 'objectGUID' field of the CN=NTDS Settings object */
712 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
713 drsuapi_DsReplicaObjectIdentifier
*naming_context
;
714 drsuapi_DsReplicaHighWaterMark old_highwatermark
;
715 drsuapi_DsReplicaHighWaterMark new_highwatermark
;
716 drsuapi_DsReplicaCursorCtrEx
*uptodateness_vector
;
717 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr
;
718 drsuapi_DsExtendedError extended_ret
; /* w2k sends the nc_object_count value here */
720 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
721 [value
(ndr_size_drsuapi_DsGetNCChangesCtr1
(r
,ndr
->flags
)+55)] uint32 __ndr_size
;
722 drsuapi_DsReplicaObjectListItemEx
*first_object
;
724 } drsuapi_DsGetNCChangesCtr1
;
727 * if the DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE flag
728 * isn't there it means the value is deleted
730 typedef [public] bitmap
{
731 DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE
= 0x00000001
732 } drsuapi_DsLinkedAttributeFlags
;
734 typedef [public] struct {
735 drsuapi_DsReplicaObjectIdentifier
*identifier
;
736 drsuapi_DsAttributeId attid
;
737 drsuapi_DsAttributeValue value
;
738 drsuapi_DsLinkedAttributeFlags flags
;
739 NTTIME_1sec originating_add_time
;
740 drsuapi_DsReplicaMetaData meta_data
;
741 } drsuapi_DsReplicaLinkedAttribute
;
743 /* [MS-DRSR] section 4.1.10.2.11 DRS_MSG_GETCHGREPLY_V6 */
744 typedef [public,gensize
] struct {
745 GUID source_dsa_guid
; /* the 'objectGUID' field of the CN=NTDS Settings object */
746 GUID source_dsa_invocation_id
; /* the 'invocationId' field of the CN=NTDS Settings object */
747 drsuapi_DsReplicaObjectIdentifier
*naming_context
;
748 drsuapi_DsReplicaHighWaterMark old_highwatermark
;
749 drsuapi_DsReplicaHighWaterMark new_highwatermark
;
750 drsuapi_DsReplicaCursor2CtrEx
*uptodateness_vector
;
751 drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr
;
752 drsuapi_DsExtendedError extended_ret
;
754 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
755 [value
(ndr_size_drsuapi_DsGetNCChangesCtr6
(r
,ndr
->flags
)+55)] uint32 __ndr_size
;
756 drsuapi_DsReplicaObjectListItemEx
*first_object
;
758 uint32 nc_object_count
; /* estimated amount of objects in the whole NC */
759 uint32 nc_linked_attributes_count
; /* estimated amount of linked values in the whole NC */
760 [range(0,1048576)] uint32 linked_attributes_count
;
761 [size_is(linked_attributes_count
)] drsuapi_DsReplicaLinkedAttribute
*linked_attributes
;
763 } drsuapi_DsGetNCChangesCtr6
;
765 typedef [public] struct {
766 [subcontext
(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr1 ctr1
;
767 } drsuapi_DsGetNCChangesCtr1TS
;
769 typedef [public] struct {
770 [subcontext
(0xFFFFFC01)] drsuapi_DsGetNCChangesCtr6 ctr6
;
771 } drsuapi_DsGetNCChangesCtr6TS
;
773 typedef [nopush
] struct {
774 uint32 decompressed_length
;
775 uint32 compressed_length
;
776 [subcontext
(4),subcontext_size
(compressed_length
),
777 compression
(NDR_COMPRESSION_MSZIP
,compressed_length
,decompressed_length
)]
778 drsuapi_DsGetNCChangesCtr1TS
*ts
;
779 } drsuapi_DsGetNCChangesMSZIPCtr1
;
781 typedef [nopush
] struct {
782 uint32 decompressed_length
;
783 uint32 compressed_length
;
784 [subcontext
(4),subcontext_size
(compressed_length
),
785 compression
(NDR_COMPRESSION_MSZIP
,compressed_length
,decompressed_length
)]
786 drsuapi_DsGetNCChangesCtr6TS
*ts
;
787 } drsuapi_DsGetNCChangesMSZIPCtr6
;
789 typedef [nopush
] struct {
790 uint32 decompressed_length
;
791 uint32 compressed_length
;
792 [subcontext
(4),subcontext_size
(compressed_length
),
793 compression
(NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2
,compressed_length
,decompressed_length
)]
794 drsuapi_DsGetNCChangesCtr1TS
*ts
;
795 } drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1
;
797 typedef [nopush
] struct {
798 uint32 decompressed_length
;
799 uint32 compressed_length
;
800 [subcontext
(4),subcontext_size
(compressed_length
),
801 compression
(NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2
,compressed_length
,decompressed_length
)]
802 drsuapi_DsGetNCChangesCtr6TS
*ts
;
803 } drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6
;
805 typedef [enum16bit
] enum {
806 DRSUAPI_COMPRESSION_TYPE_MSZIP
= 2,
807 DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2
= 3 /* CompressOrDecompressWin2k3 DRS_COMP_ALG_WIN2K3 */
808 } drsuapi_DsGetNCChangesCompressionType
;
810 typedef [nodiscriminant
,flag
(NDR_PAHEX
)] union {
811 [case(1|
(DRSUAPI_COMPRESSION_TYPE_MSZIP
<<16))] drsuapi_DsGetNCChangesMSZIPCtr1 mszip1
;
812 [case(6|
(DRSUAPI_COMPRESSION_TYPE_MSZIP
<<16))] drsuapi_DsGetNCChangesMSZIPCtr6 mszip6
;
813 [case(1|
(DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2
<<16))] drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1 xpress1
;
814 [case(6|
(DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2
<<16))] drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6 xpress6
;
815 } drsuapi_DsGetNCChangesCompressedCtr
;
818 drsuapi_DsGetNCChangesMSZIPCtr1 mszip1
;
819 } drsuapi_DsGetNCChangesCtr2
;
822 [range(0,6)] uint32 level
;
823 [range(2,3)] drsuapi_DsGetNCChangesCompressionType type
;
824 [switch_is(level |
(type
<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr
;
825 } drsuapi_DsGetNCChangesCtr7
;
827 typedef [switch_type(uint32
)] union {
828 [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1
;
829 [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2
;
830 [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6
;
831 [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7
;
832 } drsuapi_DsGetNCChangesCtr
;
834 WERROR drsuapi_DsGetNCChanges
(
835 [in] policy_handle
*bind_handle
,
837 [in,ref,switch_is(level
)] drsuapi_DsGetNCChangesRequest
*req
,
838 [out,ref] uint32
*level_out
,
839 [out,ref,switch_is(*level_out
)] drsuapi_DsGetNCChangesCtr
*ctr
844 /* [MS-DRSR] 4.1.26 */
847 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
848 [ref,charset
(DOS
),string] uint8
*dest_dsa_dns_name
;
850 drsuapi_DrsOptions options
;
851 } drsuapi_DsReplicaUpdateRefsRequest1
;
853 typedef [switch_type(uint32
)] union {
854 [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1
;
855 } drsuapi_DsReplicaUpdateRefsRequest
;
857 WERROR drsuapi_DsReplicaUpdateRefs
(
858 [in] policy_handle
*bind_handle
,
860 [in,switch_is(level
)] drsuapi_DsReplicaUpdateRefsRequest req
867 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
868 [charset
(UTF16
),string] uint16
*source_dsa_address
;
870 drsuapi_DrsOptions options
;
871 } drsuapi_DsReplicaAddRequest1
;
874 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
875 drsuapi_DsReplicaObjectIdentifier
*source_dsa_dn
;
876 drsuapi_DsReplicaObjectIdentifier
*transport_dn
;
877 [charset
(UTF16
),string] uint16
*source_dsa_address
;
879 drsuapi_DrsOptions options
;
880 } drsuapi_DsReplicaAddRequest2
;
882 typedef [switch_type(uint32
)] union {
883 [case(1)] drsuapi_DsReplicaAddRequest1 req1
;
884 [case(2)] drsuapi_DsReplicaAddRequest2 req2
;
885 } drsuapi_DsReplicaAddRequest
;
887 WERROR drsuapi_DsReplicaAdd
(
888 [in] policy_handle
*bind_handle
,
890 [in,switch_is(level
)] drsuapi_DsReplicaAddRequest req
897 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
898 [charset
(UTF8
), string] uint8
*source_dsa_address
;
899 drsuapi_DrsOptions options
;
900 } drsuapi_DsReplicaDelRequest1
;
902 typedef [switch_type(uint32
)] union {
903 [case(1)] drsuapi_DsReplicaDelRequest1 req1
;
904 } drsuapi_DsReplicaDelRequest
;
906 WERROR drsuapi_DsReplicaDel
(
907 [in] policy_handle
*bind_handle
,
909 [in,switch_is(level
)] drsuapi_DsReplicaDelRequest req
916 [ref] drsuapi_DsReplicaObjectIdentifier
*naming_context
;
918 [charset
(UTF16
),string] uint16
*source_dra_address
;
920 drsuapi_DrsOptions replica_flags
;
921 uint32 modify_fields
;
922 drsuapi_DrsOptions options
;
923 } drsuapi_DsReplicaModRequest1
;
925 typedef [switch_type(uint32
)] union {
926 [case(1)] drsuapi_DsReplicaModRequest1 req1
;
927 } drsuapi_DsReplicaModRequest
;
929 WERROR drsuapi_DsReplicaMod
(
930 [in] policy_handle
*bind_handle
,
932 [in,switch_is(level
)] drsuapi_DsReplicaModRequest req
937 [todo
] WERROR DRSUAPI_VERIFY_NAMES
();
942 /* how are type 4 and 7 different from 2 and 3 ? */
943 typedef [v1_enum] enum {
944 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS
= 1,
945 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS
= 2,
946 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS
= 3,
947 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2
= 4,
948 DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS
= 5,
949 DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS
= 6,
950 DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2
= 7
951 } drsuapi_DsMembershipType
;
955 [range(0,10000)] uint32 num_memberships
;
956 [range(0,10000)] uint32 num_sids
;
957 [size_is(num_memberships
)] drsuapi_DsReplicaObjectIdentifier
**info_array
;
958 [size_is(num_memberships
)] security_GroupAttrs
*group_attrs
;
959 [size_is(num_sids
)] dom_sid28
**sids
;
960 } drsuapi_DsGetMembershipsCtr1
;
962 typedef [switch_type(uint32
)] union {
963 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1
;
964 } drsuapi_DsGetMembershipsCtr
;
966 const int DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR
= 0x1;
969 [range(1,10000)] uint32 count
;
970 [size_is(count
)] drsuapi_DsReplicaObjectIdentifier
**info_array
;
972 [range(1,7)] drsuapi_DsMembershipType type
;
973 drsuapi_DsReplicaObjectIdentifier
*domain
;
974 } drsuapi_DsGetMembershipsRequest1
;
976 typedef [switch_type(uint32
)] union {
977 [case(1)] drsuapi_DsGetMembershipsRequest1 req1
;
978 } drsuapi_DsGetMembershipsRequest
;
980 WERROR drsuapi_DsGetMemberships
(
981 [in] policy_handle
*bind_handle
,
983 [in,ref] [switch_is(level
)] drsuapi_DsGetMembershipsRequest
*req
,
984 [out,ref] uint32
*level_out
,
985 [out,ref] [switch_is(*level_out
)] drsuapi_DsGetMembershipsCtr
*ctr
990 [todo
] WERROR DRSUAPI_INTER_DOMAIN_MOVE
();
994 typedef [bitmap32bit
] bitmap
{
995 DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG
= 0x00000001,
996 DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS
= 0x00000002
997 } drsuapi_DsGetNT4ChangeLogFlags
;
1000 drsuapi_DsGetNT4ChangeLogFlags flags
;
1001 uint32 preferred_maximum_length
;
1002 [range(0,0x00A00000)] uint32 restart_length
;
1003 [size_is(restart_length
)] uint8
*restart_data
;
1004 } drsuapi_DsGetNT4ChangeLogRequest1
;
1006 typedef [switch_type(uint32
)] union {
1007 [case(1)] drsuapi_DsGetNT4ChangeLogRequest1 req1
;
1008 } drsuapi_DsGetNT4ChangeLogRequest
;
1011 [range(0,0x00A00000)] uint32 restart_length
;
1012 [range(0,0x00A00000)] uint32 log_length
;
1013 hyper sam_serial_number
;
1014 NTTIME sam_creation_time
;
1015 hyper builtin_serial_number
;
1016 NTTIME builtin_creation_time
;
1017 hyper lsa_serial_number
;
1018 NTTIME lsa_creation_time
;
1020 [size_is(restart_length
)] uint8
*restart_data
;
1021 [size_is(log_length
)] uint8
*log_data
;
1022 } drsuapi_DsGetNT4ChangeLogInfo1
;
1024 typedef [switch_type(uint32
)] union {
1025 [case(1)] drsuapi_DsGetNT4ChangeLogInfo1 info1
;
1026 } drsuapi_DsGetNT4ChangeLogInfo
;
1028 WERROR drsuapi_DsGetNT4ChangeLog
(
1029 [in] policy_handle
*bind_handle
,
1031 [in,ref] [switch_is(level
)] drsuapi_DsGetNT4ChangeLogRequest
*req
,
1032 [out,ref] uint32
*level_out
,
1033 [out,ref] [switch_is(*level_out
)] drsuapi_DsGetNT4ChangeLogInfo
*info
1038 typedef [v1_enum] enum {
1039 DRSUAPI_DS_NAME_STATUS_OK
= 0,
1040 DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR
= 1,
1041 DRSUAPI_DS_NAME_STATUS_NOT_FOUND
= 2,
1042 DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE
= 3,
1043 DRSUAPI_DS_NAME_STATUS_NO_MAPPING
= 4,
1044 DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY
= 5,
1045 DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING
= 6,
1046 DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL
= 7
1047 } drsuapi_DsNameStatus
;
1049 typedef [v1_enum] enum {
1050 DRSUAPI_DS_NAME_FLAG_NO_FLAGS
= 0x0,
1051 DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY
= 0x1,
1052 DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC
= 0x2,
1053 DRSUAPI_DS_NAME_FLAG_GCVERIFY
= 0x4,
1054 DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL
= 0x8
1055 } drsuapi_DsNameFlags
;
1057 typedef [v1_enum] enum {
1058 DRSUAPI_DS_NAME_FORMAT_UNKNOWN
= 0x00000000,
1059 DRSUAPI_DS_NAME_FORMAT_FQDN_1779
= 0x00000001,
1060 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT
= 0x00000002,
1061 DRSUAPI_DS_NAME_FORMAT_DISPLAY
= 0x00000003,
1062 DRSUAPI_DS_NAME_FORMAT_GUID
= 0x00000006,
1063 DRSUAPI_DS_NAME_FORMAT_CANONICAL
= 0x00000007,
1064 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL
= 0x00000008,
1065 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX
= 0x00000009,
1066 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL
= 0x0000000A,
1067 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY
= 0x0000000B,
1068 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN
= 0x0000000C,
1069 DRSUAPI_DS_NAME_FORMAT_UPN_AND_ALTSECID
= 0xFFFFFFEF,
1070 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN_EX
= 0xFFFFFFF0,
1071 DRSUAPI_DS_NAME_FORMAT_LIST_GLOBAL_CATALOG_SERVERS
= 0xFFFFFFF1,
1072 DRSUAPI_DS_NAME_FORMAT_UPN_FOR_LOGON
= 0xFFFFFFF2,
1073 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_WITH_DCS_IN_SITE
= 0xFFFFFFF3,
1074 DRSUAPI_DS_NAME_FORMAT_STRING_SID_NAME
= 0xFFFFFFF4,
1075 DRSUAPI_DS_NAME_FORMAT_ALT_SECURITY_IDENTITIES_NAME
= 0xFFFFFFF5,
1076 DRSUAPI_DS_NAME_FORMAT_LIST_NCS
= 0xFFFFFFF6,
1077 DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS
= 0xFFFFFFF7,
1078 DRSUAPI_DS_NAME_FORMAT_MAP_SCHEMA_GUID
= 0xFFFFFFF8,
1079 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN
= 0xFFFFFFF9,
1080 DRSUAPI_DS_NAME_FORMAT_LIST_ROLES
= 0xFFFFFFFA,
1081 DRSUAPI_DS_NAME_FORMAT_LIST_INFO_FOR_SERVER
= 0xFFFFFFFB,
1082 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_FOR_DOMAIN_IN_SITE
= 0xFFFFFFFC,
1083 DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS_IN_SITE
= 0xFFFFFFFD,
1084 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_IN_SITE
= 0xFFFFFFFE,
1085 DRSUAPI_DS_NAME_FORMAT_LIST_SITES
= 0xFFFFFFFF
1086 } drsuapi_DsNameFormat
;
1089 [string,charset
(UTF16
)] uint16
*str
;
1090 } drsuapi_DsNameString
;
1093 uint32 codepage
; /* 0x000004e4 - 1252 is german codepage*/
1094 uint32 language
; /* 0x00000407 - german language ID*/
1095 drsuapi_DsNameFlags format_flags
;
1096 drsuapi_DsNameFormat format_offered
;
1097 drsuapi_DsNameFormat format_desired
;
1098 [range(1,10000)] uint32 count
;
1099 [size_is(count
)] drsuapi_DsNameString
*names
;
1100 } drsuapi_DsNameRequest1
;
1102 typedef [switch_type(uint32
)] union {
1103 [case(1)] drsuapi_DsNameRequest1 req1
;
1104 } drsuapi_DsNameRequest
;
1107 drsuapi_DsNameStatus status
;
1108 [charset
(UTF16
),string] uint16
*dns_domain_name
;
1109 [charset
(UTF16
),string] uint16
*result_name
;
1110 } drsuapi_DsNameInfo1
;
1114 [size_is(count
)] drsuapi_DsNameInfo1
*array
;
1115 } drsuapi_DsNameCtr1
;
1117 typedef [switch_type(uint32
)] union {
1118 [case(1)] drsuapi_DsNameCtr1
*ctr1
;
1119 } drsuapi_DsNameCtr
;
1121 WERROR drsuapi_DsCrackNames
(
1122 [in] policy_handle
*bind_handle
,
1124 [in,ref,switch_is(level
)] drsuapi_DsNameRequest
*req
,
1125 [out,ref] uint32
*level_out
,
1126 [out,ref,switch_is(*level_out
)] drsuapi_DsNameCtr
*ctr
1131 typedef [v1_enum] enum {
1132 DRSUAPI_DS_SPN_OPERATION_ADD
= 0,
1133 DRSUAPI_DS_SPN_OPERATION_REPLACE
= 1,
1134 DRSUAPI_DS_SPN_OPERATION_DELETE
= 2
1135 } drsuapi_DsSpnOperation
;
1138 drsuapi_DsSpnOperation operation
;
1140 [charset
(UTF16
),string] uint16
*object_dn
;
1141 [range(0,10000)] uint32 count
;
1142 [size_is(count
)] drsuapi_DsNameString
*spn_names
;
1143 } drsuapi_DsWriteAccountSpnRequest1
;
1145 typedef [switch_type(uint32
)] union {
1146 [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1
;
1147 } drsuapi_DsWriteAccountSpnRequest
;
1151 } drsuapi_DsWriteAccountSpnResult1
;
1153 typedef [switch_type(uint32
)] union {
1154 [case(1)] drsuapi_DsWriteAccountSpnResult1 res1
;
1155 } drsuapi_DsWriteAccountSpnResult
;
1157 WERROR drsuapi_DsWriteAccountSpn
(
1158 [in] policy_handle
*bind_handle
,
1160 [in,ref,switch_is(level
)] drsuapi_DsWriteAccountSpnRequest
*req
,
1161 [out,ref] uint32
*level_out
,
1162 [out,ref,switch_is(*level_out
)] drsuapi_DsWriteAccountSpnResult
*res
1168 [charset
(UTF16
),string] uint16
*server_dn
;
1169 [charset
(UTF16
),string] uint16
*domain_dn
;
1171 } drsuapi_DsRemoveDSServerRequest1
;
1173 typedef [switch_type(uint32
)] union {
1174 [case(1)] drsuapi_DsRemoveDSServerRequest1 req1
;
1175 } drsuapi_DsRemoveDSServerRequest
;
1178 boolean32 last_dc_in_domain
;
1179 } drsuapi_DsRemoveDSServerResult1
;
1181 typedef [switch_type(uint32
)] union {
1182 [case(1)] drsuapi_DsRemoveDSServerResult1 res1
;
1183 } drsuapi_DsRemoveDSServerResult
;
1185 WERROR drsuapi_DsRemoveDSServer
(
1186 [in] policy_handle
*bind_handle
,
1188 [in,ref,switch_is(level
)] drsuapi_DsRemoveDSServerRequest
*req
,
1189 [out,ref] uint32
*level_out
,
1190 [out,ref,switch_is(*level_out
)] drsuapi_DsRemoveDSServerResult
*res
1195 [todo
] WERROR DRSUAPI_REMOVE_DS_DOMAIN
();
1199 typedef [v1_enum] enum {
1200 DRSUAPI_DC_INFO_CTR_1
= 1,
1201 DRSUAPI_DC_INFO_CTR_2
= 2,
1202 DRSUAPI_DC_INFO_CTR_3
= 3,
1203 DRSUAPI_DC_CONNECTION_CTR_01
= 0xFFFFFFFF
1204 } drsuapi_DsGetDCInfoCtrLevels
;
1207 [charset
(UTF16
),string] uint16
*domain_name
; /* netbios or dns */
1208 drsuapi_DsGetDCInfoCtrLevels level
; /* specifies the switch level for the request */
1209 } drsuapi_DsGetDCInfoRequest1
;
1211 typedef [switch_type(uint32
)] union {
1212 [case(1)] drsuapi_DsGetDCInfoRequest1 req1
;
1213 } drsuapi_DsGetDCInfoRequest
;
1216 [charset
(UTF16
),string] uint16
*netbios_name
;
1217 [charset
(UTF16
),string] uint16
*dns_name
;
1218 [charset
(UTF16
),string] uint16
*site_name
;
1219 [charset
(UTF16
),string] uint16
*computer_dn
;
1220 [charset
(UTF16
),string] uint16
*server_dn
;
1223 } drsuapi_DsGetDCInfo1
;
1226 [range(0,10000)] uint32 count
;
1227 [size_is(count
)] drsuapi_DsGetDCInfo1
*array
;
1228 } drsuapi_DsGetDCInfoCtr1
;
1231 [charset
(UTF16
),string] uint16
*netbios_name
;
1232 [charset
(UTF16
),string] uint16
*dns_name
;
1233 [charset
(UTF16
),string] uint16
*site_name
;
1234 [charset
(UTF16
),string] uint16
*site_dn
;
1235 [charset
(UTF16
),string] uint16
*computer_dn
;
1236 [charset
(UTF16
),string] uint16
*server_dn
;
1237 [charset
(UTF16
),string] uint16
*ntds_dn
;
1245 } drsuapi_DsGetDCInfo2
;
1248 [range(0,10000)] uint32 count
;
1249 [size_is(count
)] drsuapi_DsGetDCInfo2
*array
;
1250 } drsuapi_DsGetDCInfoCtr2
;
1253 [charset
(UTF16
),string] uint16
*netbios_name
;
1254 [charset
(UTF16
),string] uint16
*dns_name
;
1255 [charset
(UTF16
),string] uint16
*site_name
;
1256 [charset
(UTF16
),string] uint16
*site_dn
;
1257 [charset
(UTF16
),string] uint16
*computer_dn
;
1258 [charset
(UTF16
),string] uint16
*server_dn
;
1259 [charset
(UTF16
),string] uint16
*ntds_dn
;
1268 } drsuapi_DsGetDCInfo3
;
1271 [range(0,10000)] uint32 count
;
1272 [size_is(count
)] drsuapi_DsGetDCInfo3
*array
;
1273 } drsuapi_DsGetDCInfoCtr3
;
1276 * this represents an active connection to the
1277 * Directory System Agent (DSA)
1278 * this can be via LDAP or DRSUAPI
1281 [flag
(NDR_BIG_ENDIAN
)] ipv4address client_ip_address
;
1283 uint32 connection_time
; /* in seconds */
1288 * client_account can be the following:
1289 * "W2K3\Administrator"
1290 * "Administrator@W2K3"
1291 * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base"
1295 [charset
(UTF16
),string] uint16
*client_account
;
1296 } drsuapi_DsGetDCConnection01
;
1299 [range(0,10000)] uint32 count
;
1300 [size_is(count
)] drsuapi_DsGetDCConnection01
*array
;
1301 } drsuapi_DsGetDCConnectionCtr01
;
1303 typedef [switch_type(drsuapi_DsGetDCInfoCtrLevels
)] union {
1304 [case(DRSUAPI_DC_INFO_CTR_1
)] drsuapi_DsGetDCInfoCtr1 ctr1
;
1305 [case(DRSUAPI_DC_INFO_CTR_2
)] drsuapi_DsGetDCInfoCtr2 ctr2
;
1306 [case(DRSUAPI_DC_INFO_CTR_3
)] drsuapi_DsGetDCInfoCtr3 ctr3
;
1307 [case(DRSUAPI_DC_CONNECTION_CTR_01
)] drsuapi_DsGetDCConnectionCtr01 ctr01
;
1308 } drsuapi_DsGetDCInfoCtr
;
1310 WERROR drsuapi_DsGetDomainControllerInfo
(
1311 [in] policy_handle
*bind_handle
,
1313 [in,ref,switch_is(level
)] drsuapi_DsGetDCInfoRequest
*req
,
1314 [out,ref] drsuapi_DsGetDCInfoCtrLevels
*level_out
,
1315 [out,ref,switch_is(*level_out
)] drsuapi_DsGetDCInfoCtr
*ctr
1320 typedef [public,noprint
] struct {
1321 [max_recursion
(20000)]
1322 drsuapi_DsReplicaObjectListItem
*next_object
;
1323 drsuapi_DsReplicaObject
object;
1324 } drsuapi_DsReplicaObjectListItem
;
1327 * The DsAddEntry() call which creates a nTDSDSA object,
1328 * also adds a servicePrincipalName in the following form
1329 * to the computer account of the new domain controller
1330 * referenced by the "serverReferenece" attribute.
1332 * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name>
1334 * also note that the "serverReference" isn't added to the new object!
1336 const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID
= "E3514235-4B06-11D1-AB04-00C04FC2DCD2";
1338 /* Error codes to classify an error that occurs
1339 * during a search for, or the update of,
1340 * a directory object */
1341 typedef [v1_enum] enum {
1342 DRSUAPI_DIRERR_OK
= 0,
1343 DRSUAPI_DIRERR_ATTRIBUTE
= 1,
1344 DRSUAPI_DIRERR_NAME
= 2,
1345 DRSUAPI_DIRERR_REFERRAL
= 3,
1346 DRSUAPI_DIRERR_SECURITY
= 4,
1347 DRSUAPI_DIRERR_SERVICE
= 5,
1348 DRSUAPI_DIRERR_UPDATE
= 6,
1349 DRSUAPI_DIRERR_SYSTEM
= 7
1350 } drsuapi_DsAddEntry_DirErr
;
1353 * Ref: DRS_MSG_ADDENTRYREQ_V2, [MS-DRSR]: 4.1.1.1.3
1356 drsuapi_DsReplicaObjectListItem first_object
;
1357 } drsuapi_DsAddEntryRequest2
;
1359 /* Buffer type is actually more
1361 * Ref: DRS_SecBuffer, [MS-DRSR]: 5.41 */
1362 typedef [v1_enum,noprint
] enum {
1363 DRSUAPI_SECBUFFER_EMPTY
= 0x00000000,
1364 DRSUAPI_SECBUFFER_DATA
= 0x00000001,
1365 DRSUAPI_SECBUFFER_TOKEN
= 0x00000002,
1366 DRSUAPI_SECBUFFER_PKG_PARAMS
= 0x00000003,
1367 DRSUAPI_SECBUFFER_MISSING
= 0x00000004,
1368 DRSUAPI_SECBUFFER_EXTRA
= 0x00000005,
1369 DRSUAPI_SECBUFFER_STREAM_TRAILER
= 0x00000006,
1370 DRSUAPI_SECBUFFER_STREAM_HEADER
= 0x00000007,
1371 DRSUAPI_SECBUFFER_READONLY
= 0x80000000
1372 } drsuapi_SecBufferType
;
1375 [range(0,10000)] uint32 buf_size
;
1376 drsuapi_SecBufferType buf_type
;
1377 [size_is(buf_size
)] uint8
*buffer
;
1378 } drsuapi_SecBuffer
;
1381 [value
(0)] uint32
version;
1382 [range(0,10000)] uint32 buff_count
;
1383 [size_is(buff_count
)] drsuapi_SecBuffer
*buffers
;
1384 } drsuapi_SecBufferDesc
;
1387 * Ref: DRS_MSG_ADDENTRYREQ_V3, [MS-DRSR]: 4.1.1.1.4
1390 drsuapi_DsReplicaObjectListItem first_object
;
1391 drsuapi_SecBufferDesc
*client_creds
;
1392 } drsuapi_DsAddEntryRequest3
;
1394 typedef [switch_type(uint32
)] union {
1395 [case(2)] drsuapi_DsAddEntryRequest2 req2
;
1396 [case(3)] drsuapi_DsAddEntryRequest3 req3
;
1397 } drsuapi_DsAddEntryRequest
;
1399 /* Generic extended error info
1400 * commonly used in most places
1401 * where rich error info is returned */
1403 uint32 dsid
; /* implementation-specific diagnostic code */
1404 WERROR extended_err
; /* 0, STATUS code, or Windows error code */
1405 uint32 extended_data
; /* implementation-specific diagnostic code */
1406 uint16 problem
; /* 0 or PROBLEM error code */
1407 } drsuapi_DsAddEntryErrorInfoX
;
1410 * Ref: ATRERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.11 */
1413 WERROR extended_err
;
1414 uint32 extended_data
;
1416 drsuapi_DsAttributeId attid
;
1417 boolean32 is_val_returned
;
1418 drsuapi_DsAttributeValue attr_val
;
1419 } drsuapi_DsAddEntry_AttrErr_V1
;
1421 typedef [noprint
] struct {
1422 [max_recursion
(20000)]
1423 drsuapi_DsAddEntry_AttrErrListItem_V1
*next
;
1424 drsuapi_DsAddEntry_AttrErr_V1 err_data
;
1425 } drsuapi_DsAddEntry_AttrErrListItem_V1
;
1428 drsuapi_DsReplicaObjectIdentifier
*id;
1430 drsuapi_DsAddEntry_AttrErrListItem_V1 first
;
1431 } drsuapi_DsAddEntryErrorInfo_Attr_V1
;
1433 /* Name resolution error
1434 * Ref: NAMERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.14 */
1437 WERROR extended_err
;
1438 uint32 extended_data
;
1440 drsuapi_DsReplicaObjectIdentifier
*id_matched
; /* The best match for the supplied object identity */
1441 } drsuapi_DsAddEntryErrorInfo_Name_V1
;
1444 * Ref: REFERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.15 */
1446 [value
(83)] uint8 name_res
; /* Must be 'S' */
1447 [value
(0)] uint8 unused_pad
;
1448 [value
(0)] uint16 next_rdn
;
1449 } drsuapi_NameResOp_V1
;
1451 typedef [enum16bit
] enum {
1452 DRSUAPI_CH_REFTYPE_SUPERIOR
= 0x0000, /* referral to a superior DC */
1453 DRSUAPI_CH_REFTYPE_SUBORDINATE
= 0x0001, /* referral to a subordinate DC */
1454 DRSUAPI_CH_REFTYPE_NSSR
= 0x0002, /* Not used */
1455 DRSUAPI_CH_REFTYPE_CROSS
= 0x0003 /* A referral to an external crossRef object */
1456 } drsuapi_DsAddEntry_RefType
;
1458 typedef [enum8bit
] enum {
1459 DRSUAPI_SE_CHOICE_BASE_ONLY
= 0x00,
1460 DRSUAPI_SE_CHOICE_IMMED_CHLDRN
= 0x01,
1461 DRSUAPI_SE_CHOICE_WHOLE_SUBTREE
= 0x02
1462 } drsuapi_DsAddEntry_ChoiceType
;
1464 /* list of network names of the DCs
1465 * to which the referral is directed */
1467 [max_recursion
(1024)] drsuapi_DsaAddressListItem_V1
*next
;
1468 lsa_String
*address
;
1469 } drsuapi_DsaAddressListItem_V1
;
1472 drsuapi_DsReplicaObjectIdentifier
*id_target
; /* object to which the referral is directed */
1473 drsuapi_NameResOp_V1 op_state
;
1474 [value
(0)] uint16 rdn_alias
;
1475 [value
(0)] uint16 rdn_internal
;
1476 drsuapi_DsAddEntry_RefType ref_type
;
1477 uint16 addr_list_count
;
1478 drsuapi_DsaAddressListItem_V1
*addr_list
;
1479 [max_recursion
(20000)]
1480 drsuapi_DsAddEntry_RefErrListItem_V1
*next
;
1481 boolean32 is_choice_set
;
1482 drsuapi_DsAddEntry_ChoiceType choice
;
1483 } drsuapi_DsAddEntry_RefErrListItem_V1
;
1487 WERROR extended_err
;
1488 uint32 extended_data
;
1489 drsuapi_DsAddEntry_RefErrListItem_V1 refer
;
1490 } drsuapi_DsAddEntryErrorInfo_Referr_V1
;
1492 typedef [switch_type(uint32
)] union {
1493 [case(1)] drsuapi_DsAddEntryErrorInfo_Attr_V1 attr_err
;
1494 [case(2)] drsuapi_DsAddEntryErrorInfo_Name_V1 name_err
;
1495 [case(3)] drsuapi_DsAddEntryErrorInfo_Referr_V1 referral_err
;
1496 [case(4)] drsuapi_DsAddEntryErrorInfoX security_err
;
1497 [case(5)] drsuapi_DsAddEntryErrorInfoX service_err
;
1498 [case(6)] drsuapi_DsAddEntryErrorInfoX update_err
;
1499 [case(7)] drsuapi_DsAddEntryErrorInfoX system_err
;
1500 } drsuapi_DsAddEntryErrorInfo
;
1504 drsuapi_DsAddEntry_DirErr dir_err
;
1505 [switch_is(dir_err
)] drsuapi_DsAddEntryErrorInfo
*info
;
1506 } drsuapi_DsAddEntry_ErrData_V1
;
1508 typedef [switch_type(uint32
)] union {
1509 [case(1)] drsuapi_DsAddEntry_ErrData_V1 v1
;
1510 } drsuapi_DsAddEntry_ErrData
;
1515 } drsuapi_DsReplicaObjectIdentifier2
;
1518 drsuapi_DsReplicaObjectIdentifier
*id;
1519 drsuapi_DsAddEntry_DirErr dir_err
;
1520 uint32 dsid
; /* implementation-specific diagnostic code */
1521 WERROR extended_err
; /* 0, STATUS code, or Windows error code */
1522 uint32 extended_data
; /* implementation-specific diagnostic code */
1523 uint16 problem
; /* 0 or PROBLEM error code */
1524 [range(0,10000)] uint32 count
;
1525 [size_is(count
)] drsuapi_DsReplicaObjectIdentifier2
*objects
;
1526 } drsuapi_DsAddEntryCtr2
;
1529 drsuapi_DsReplicaObjectIdentifier
*id;
1530 uint32 err_ver
; /* Must be 1 */
1531 [switch_is(err_ver
)] drsuapi_DsAddEntry_ErrData
*err_data
;
1532 [range(0,10000)] uint32 count
;
1533 [size_is(count
)] drsuapi_DsReplicaObjectIdentifier2
*objects
;
1534 } drsuapi_DsAddEntryCtr3
;
1536 typedef [switch_type(uint32
)] union {
1537 [case(2)] drsuapi_DsAddEntryCtr2 ctr2
;
1538 [case(3)] drsuapi_DsAddEntryCtr3 ctr3
;
1539 } drsuapi_DsAddEntryCtr
;
1541 [public] WERROR drsuapi_DsAddEntry
(
1542 [in] policy_handle
*bind_handle
,
1544 [in,ref,switch_is(level
)] drsuapi_DsAddEntryRequest
*req
,
1545 [out,ref] uint32
*level_out
,
1546 [out,ref,switch_is(*level_out
)] drsuapi_DsAddEntryCtr
*ctr
1552 DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION
= 0x00000001,
1553 DRSUAPI_DS_EXECUTE_KCC_DAMPED
= 0x00000002
1554 } drsuapi_DsExecuteKCCFlags
;
1558 drsuapi_DsExecuteKCCFlags flags
;
1559 } drsuapi_DsExecuteKCC1
;
1561 typedef [switch_type(uint32
)] union {
1562 [case(1)] drsuapi_DsExecuteKCC1 ctr1
;
1563 } drsuapi_DsExecuteKCCRequest
;
1565 WERROR drsuapi_DsExecuteKCC
(
1566 [in] policy_handle
*bind_handle
,
1568 [in, ref, switch_is(level
)] drsuapi_DsExecuteKCCRequest
*req
1573 typedef [v1_enum] enum {
1574 DRSUAPI_DS_REPLICA_GET_INFO
= 1,
1575 DRSUAPI_DS_REPLICA_GET_INFO2
= 2
1576 } drsuapi_DsReplicaGetInfoLevel
;
1578 typedef [v1_enum] enum {
1579 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS
= 0,
1580 DRSUAPI_DS_REPLICA_INFO_CURSORS
= 1,
1581 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA
= 2,
1582 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES
= 3,
1583 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES
= 4,
1584 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS
= 5,
1585 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA
= 6,
1586 DRSUAPI_DS_REPLICA_INFO_CURSORS2
= 7,
1587 DRSUAPI_DS_REPLICA_INFO_CURSORS3
= 8,
1588 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2
= 9,
1589 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2
= 10,
1590 DRSUAPI_DS_REPLICA_INFO_REPSTO
= -2,
1591 DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS
= -4,
1592 DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1
= -5,
1593 DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS
= -6
1594 } drsuapi_DsReplicaInfoType
;
1597 drsuapi_DsReplicaInfoType info_type
;
1598 [charset
(UTF16
),string] uint16
*object_dn
;
1599 GUID source_dsa_guid
;
1600 } drsuapi_DsReplicaGetInfoRequest1
;
1603 drsuapi_DsReplicaInfoType info_type
;
1604 [charset
(UTF16
),string] uint16
*object_dn
;
1605 GUID source_dsa_guid
;
1607 [charset
(UTF16
),string] uint16
*attribute_name
;
1608 [charset
(UTF16
),string] uint16
*value_dn_str
;
1609 uint32 enumeration_context
;
1610 } drsuapi_DsReplicaGetInfoRequest2
;
1612 typedef [switch_type(drsuapi_DsReplicaGetInfoLevel
)] union {
1613 [case(DRSUAPI_DS_REPLICA_GET_INFO
)] drsuapi_DsReplicaGetInfoRequest1 req1
;
1614 [case(DRSUAPI_DS_REPLICA_GET_INFO2
)] drsuapi_DsReplicaGetInfoRequest2 req2
;
1615 } drsuapi_DsReplicaGetInfoRequest
;
1618 [charset
(UTF16
),string] uint16
*naming_context_dn
;
1619 [charset
(UTF16
),string] uint16
*source_dsa_obj_dn
;
1620 [charset
(UTF16
),string] uint16
*source_dsa_address
;
1621 [charset
(UTF16
),string] uint16
*transport_obj_dn
;
1622 drsuapi_DrsOptions replica_flags
;
1624 GUID naming_context_obj_guid
;
1625 GUID source_dsa_obj_guid
;
1626 GUID source_dsa_invocation_id
;
1627 GUID transport_obj_guid
;
1628 hyper tmp_highest_usn
;
1630 NTTIME last_success
;
1631 NTTIME last_attempt
;
1632 WERROR result_last_attempt
;
1633 uint32 consecutive_sync_failures
;
1634 } drsuapi_DsReplicaNeighbour
;
1639 [size_is(count
)] drsuapi_DsReplicaNeighbour array
[];
1640 } drsuapi_DsReplicaNeighbourCtr
;
1645 [size_is(count
)] drsuapi_DsReplicaCursor array
[];
1646 } drsuapi_DsReplicaCursorCtr
;
1649 [charset
(UTF16
),string] uint16
*attribute_name
;
1651 NTTIME originating_change_time
;
1652 GUID originating_invocation_id
;
1653 hyper originating_usn
;
1655 } drsuapi_DsReplicaObjMetaData
;
1660 [size_is(count
)] drsuapi_DsReplicaObjMetaData array
[];
1661 } drsuapi_DsReplicaObjMetaDataCtr
;
1664 [charset
(UTF16
),string] uint16
*dsa_obj_dn
;
1666 NTTIME first_failure
;
1667 uint32 num_failures
;
1669 } drsuapi_DsReplicaKccDsaFailure
;
1674 [size_is(count
)] drsuapi_DsReplicaKccDsaFailure array
[];
1675 } drsuapi_DsReplicaKccDsaFailuresCtr
;
1678 DRSUAPI_DS_REPLICA_OP_TYPE_SYNC
= 0,
1679 DRSUAPI_DS_REPLICA_OP_TYPE_ADD
= 1,
1680 DRSUAPI_DS_REPLICA_OP_TYPE_DELETE
= 2,
1681 DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY
= 3,
1682 DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS
= 4
1683 } drsuapi_DsReplicaOpType
;
1686 NTTIME operation_start
;
1687 uint32 serial_num
; /* unique till reboot */
1689 drsuapi_DsReplicaOpType operation_type
;
1690 drsuapi_DrsOptions options
;
1691 [charset
(UTF16
),string] uint16
*nc_dn
;
1692 [charset
(UTF16
),string] uint16
*remote_dsa_obj_dn
;
1693 [charset
(UTF16
),string] uint16
*remote_dsa_address
;
1695 GUID remote_dsa_obj_guid
;
1696 } drsuapi_DsReplicaOp
;
1701 [size_is(count
)] drsuapi_DsReplicaOp array
[];
1702 } drsuapi_DsReplicaOpCtr
;
1705 [charset
(UTF16
),string] uint16
*attribute_name
;
1706 [charset
(UTF16
),string] uint16
*object_dn
;
1707 [value
(ndr_size_DATA_BLOB
(0,binary
,0))] uint32 __ndr_size_binary
;
1712 NTTIME originating_change_time
;
1713 GUID originating_invocation_id
;
1714 hyper originating_usn
;
1716 } drsuapi_DsReplicaAttrValMetaData
;
1720 uint32 enumeration_context
;
1721 [size_is(count
)] drsuapi_DsReplicaAttrValMetaData array
[];
1722 } drsuapi_DsReplicaAttrValMetaDataCtr
;
1726 uint32 enumeration_context
;
1727 [size_is(count
)] drsuapi_DsReplicaCursor2 array
[];
1728 } drsuapi_DsReplicaCursor2Ctr
;
1731 GUID source_dsa_invocation_id
;
1733 NTTIME last_sync_success
;
1734 [charset
(UTF16
),string] uint16
*source_dsa_obj_dn
;
1735 } drsuapi_DsReplicaCursor3
;
1739 uint32 enumeration_context
;
1740 [size_is(count
)] drsuapi_DsReplicaCursor3 array
[];
1741 } drsuapi_DsReplicaCursor3Ctr
;
1744 [charset
(UTF16
),string] uint16
*attribute_name
;
1746 NTTIME originating_change_time
;
1747 GUID originating_invocation_id
;
1748 hyper originating_usn
;
1750 [charset
(UTF16
),string] uint16
*originating_dsa_dn
;
1751 } drsuapi_DsReplicaObjMetaData2
;
1755 uint32 enumeration_context
;
1756 [size_is(count
)] drsuapi_DsReplicaObjMetaData2 array
[];
1757 } drsuapi_DsReplicaObjMetaData2Ctr
;
1760 [charset
(UTF16
),string] uint16
*attribute_name
;
1761 [charset
(UTF16
),string] uint16
*object_dn
;
1762 [value
(ndr_size_DATA_BLOB
(0,binary
,0))] uint32 __ndr_size_binary
;
1767 NTTIME originating_change_time
;
1768 GUID originating_invocation_id
;
1769 hyper originating_usn
;
1771 [charset
(UTF16
),string] uint16
*originating_dsa_dn
;
1772 } drsuapi_DsReplicaAttrValMetaData2
;
1776 uint32 enumeration_context
;
1777 [size_is(count
)] drsuapi_DsReplicaAttrValMetaData2 array
[];
1778 } drsuapi_DsReplicaAttrValMetaData2Ctr
;
1781 hyper u1
; /* session number? */
1785 NTTIME_1sec bind_time
;
1786 [flag
(NDR_BIG_ENDIAN
)] ipv4address client_ip_address
;
1787 uint32 u5
; /* this is the same value the client used as pid in the DsBindInfoX struct */
1788 } drsuapi_DsReplicaConnection04
;
1791 [range(0,10000)] uint32 count
;
1793 [size_is(count
)] drsuapi_DsReplicaConnection04 array
[];
1794 } drsuapi_DsReplicaConnection04Ctr
;
1797 [charset
(UTF16
),string] uint16
*str1
;
1805 } drsuapi_DsReplica06
;
1808 [range(0,256)] uint32 count
;
1810 [size_is(count
)] drsuapi_DsReplica06 array
[];
1811 } drsuapi_DsReplica06Ctr
;
1813 typedef [switch_type(drsuapi_DsReplicaInfoType
)] union {
1814 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS
)] drsuapi_DsReplicaNeighbourCtr
*neighbours
;
1815 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS
)] drsuapi_DsReplicaCursorCtr
*cursors
;
1816 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA
)] drsuapi_DsReplicaObjMetaDataCtr
*objmetadata
;
1817 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES
)] drsuapi_DsReplicaKccDsaFailuresCtr
*connectfailures
;
1818 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES
)] drsuapi_DsReplicaKccDsaFailuresCtr
*linkfailures
;
1819 [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS
)] drsuapi_DsReplicaOpCtr
*pendingops
;
1820 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA
)] drsuapi_DsReplicaAttrValMetaDataCtr
*attrvalmetadata
;
1821 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2
)] drsuapi_DsReplicaCursor2Ctr
*cursors2
;
1822 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3
)] drsuapi_DsReplicaCursor3Ctr
*cursors3
;
1823 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2
)] drsuapi_DsReplicaObjMetaData2Ctr
*objmetadata2
;
1824 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2
)] drsuapi_DsReplicaAttrValMetaData2Ctr
*attrvalmetadata2
;
1825 [case(DRSUAPI_DS_REPLICA_INFO_REPSTO
)] drsuapi_DsReplicaNeighbourCtr
*repsto
;
1826 [case(DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS
)] drsuapi_DsReplicaConnection04Ctr
*clientctx
;
1827 [case(DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1
)] drsuapi_DsReplicaCursorCtrEx
*udv1
;
1828 [case(DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS
)] drsuapi_DsReplica06Ctr
*srvoutgoingcalls
;
1829 } drsuapi_DsReplicaInfo
;
1831 WERROR drsuapi_DsReplicaGetInfo
(
1832 [in] policy_handle
*bind_handle
,
1833 [in] drsuapi_DsReplicaGetInfoLevel level
,
1834 [in,ref,switch_is(level
)] drsuapi_DsReplicaGetInfoRequest
*req
,
1835 [out,ref] drsuapi_DsReplicaInfoType
*info_type
,
1836 [out,ref,switch_is(*info_type
)] drsuapi_DsReplicaInfo
*info
1841 [todo
] WERROR DRSUAPI_ADD_SID_HISTORY
();
1847 [range(0,10000)] uint32 num_entries
;
1848 [size_is(num_entries
)] drsuapi_DsGetMembershipsCtr1
**ctrl_array
;
1849 } drsuapi_DsGetMemberships2Ctr1
;
1851 typedef [switch_type(uint32
)] union {
1852 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1
;
1853 } drsuapi_DsGetMemberships2Ctr
;
1856 [range(1,10000)] uint32 num_req
;
1857 [size_is(num_req
)] drsuapi_DsGetMembershipsRequest1
**req_array
;
1858 } drsuapi_DsGetMemberships2Request1
;
1860 typedef [switch_type(uint32
)] union {
1861 [case(1)] drsuapi_DsGetMemberships2Request1 req1
;
1862 } drsuapi_DsGetMemberships2Request
;
1864 WERROR drsuapi_DsGetMemberships2
(
1865 [in] policy_handle
*bind_handle
,
1867 [in,ref] [switch_is(level
)] drsuapi_DsGetMemberships2Request
*req
,
1868 [out,ref] uint32
*level_out
,
1869 [out,ref] [switch_is(*level_out
)] drsuapi_DsGetMemberships2Ctr
*ctr
1874 [todo
] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS
();
1878 [todo
] WERROR DRSUAPI_GET_OBJECT_EXISTENCE
();
1885 } drsuapi_DsSiteCostInfo
;
1888 [range(0,10000)] uint32 num_info
;
1889 [size_is(num_info
)] drsuapi_DsSiteCostInfo
*info
;
1890 [value
(0)] uint32 flags_reserved
;
1891 } drsuapi_QuerySitesByCostCtr1
;
1893 typedef [switch_type(uint32
)] union {
1894 [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1
;
1895 } drsuapi_QuerySitesByCostCtr
;
1898 [charset
(UTF16
),string] uint16
*site_from
;
1899 [range(1,10000)] uint32 num_req
;
1900 [size_is(num_req
)] [charset
(UTF16
),string] uint16
**site_to
;
1902 } drsuapi_QuerySitesByCostRequest1
;
1904 typedef [switch_type(uint32
)] union {
1905 [case(1)] drsuapi_QuerySitesByCostRequest1 req1
;
1906 } drsuapi_QuerySitesByCostRequest
;
1908 WERROR drsuapi_QuerySitesByCost
(
1909 [in] policy_handle
*bind_handle
,
1911 [in,ref] [switch_is(level
)] drsuapi_QuerySitesByCostRequest
*req
,
1912 [out,ref] uint32
*level_out
,
1913 [out,ref] [switch_is(*level_out
)] drsuapi_QuerySitesByCostCtr
*ctr