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