Convenient script for build and test idl changes
[drsuapi_dissector.git] / drsuapi / drsuapi.idl
blobfa7c643a5c7823f41dba7763bbefe02df6679cc6
1 #include "idl_types.h"
4 uuid("e3514235-4b06-11d1-ab04-00c04fc2dcd2"),
5 version(4.0),
6 endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]", "ncacn_ip_tcp:", "ncalrpc:"),
7 authservice("ldap"),
8 helpstring("Active Directory Replication"),
9 pointer_default(unique)
11 interface drsuapi
14 /* see MS-DRSR section 5.39 */
15 typedef [public,bitmap32bit] bitmap {
16 DRSUAPI_DRS_ASYNC_OP = 0x00000001,
17 DRSUAPI_DRS_GETCHG_CHECK = 0x00000002,
18 DRSUAPI_DRS_UPDATE_NOTIFICATION = 0x00000002,
19 DRSUAPI_DRS_ADD_REF = 0x00000004,
20 DRSUAPI_DRS_SYNC_ALL = 0x00000008,
21 DRSUAPI_DRS_DEL_REF = 0x00000008,
22 DRSUAPI_DRS_WRIT_REP = 0x00000010,
23 DRSUAPI_DRS_INIT_SYNC = 0x00000020,
24 DRSUAPI_DRS_PER_SYNC = 0x00000040,
25 DRSUAPI_DRS_MAIL_REP = 0x00000080,
26 DRSUAPI_DRS_ASYNC_REP = 0x00000100,
27 DRSUAPI_DRS_IGNORE_ERROR = 0x00000100,
28 DRSUAPI_DRS_TWOWAY_SYNC = 0x00000200,
29 DRSUAPI_DRS_CRITICAL_ONLY = 0x00000400,
30 DRSUAPI_DRS_GET_ANC = 0x00000800,
31 DRSUAPI_DRS_GET_NC_SIZE = 0x00001000,
32 DRSUAPI_DRS_LOCAL_ONLY = 0x00001000,
33 DRSUAPI_DRS_SYNC_BYNAME = 0x00004000,
34 DRSUAPI_DRS_REF_OK = 0x00004000,
35 DRSUAPI_DRS_FULL_SYNC_NOW = 0x00008000,
36 DRSUAPI_DRS_NO_SOURCE = 0x00008000,
37 DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS = 0x00010000,
38 DRSUAPI_DRS_FULL_SYNC_PACKET = 0x00020000,
39 DRSUAPI_DRS_SYNC_REQUEUE = 0x00040000,
40 DRSUAPI_DRS_SYNC_URGENT = 0x00080000,
41 DRSUAPI_DRS_REF_GCSPN = 0x00100000,
42 DRSUAPI_DRS_NO_DISCARD = 0x00100000,
43 DRSUAPI_DRS_NEVER_SYNCED = 0x00200000,
44 DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING = 0x00400000,
45 DRSUAPI_DRS_INIT_SYNC_NOW = 0x00800000,
46 DRSUAPI_DRS_PREEMPTED = 0x01000000,
47 DRSUAPI_DRS_SYNC_FORCED = 0x02000000,
48 DRSUAPI_DRS_DISABLE_AUTO_SYNC = 0x04000000,
49 DRSUAPI_DRS_DISABLE_PERIODIC_SYNC = 0x08000000,
50 DRSUAPI_DRS_USE_COMPRESSION = 0x10000000,
51 DRSUAPI_DRS_NEVER_NOTIFY = 0x20000000,
52 DRSUAPI_DRS_SYNC_PAS = 0x40000000,
53 DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP = 0x80000000
54 } drsuapi_DrsOptions;
56 /*****************/
57 /* Function 0x00 */
58 typedef [bitmap32bit] bitmap {
59 DRSUAPI_SUPPORTED_EXTENSION_BASE = 0x00000001,
60 DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION = 0x00000002,
61 DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI = 0x00000004,
62 DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2 = 0x00000008,
63 DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS = 0x00000010,
64 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 = 0x00000020,
65 DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION = 0x00000040,
66 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY = 0x00000080,
67 DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE = 0x00000100,
68 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 = 0x00000200,
69 DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION = 0x00000400,
70 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2 = 0x00000800,
71 DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD= 0x00001000,
72 DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND = 0x00002000,
73 DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO = 0x00004000,
74 DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION = 0x00008000,
75 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01 = 0x00010000,
76 DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP = 0x00020000,
77 DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY = 0x00040000,
78 DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 = 0x00080000,
79 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V5 = 0x00100000,
80 DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 = 0x00200000,
81 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 = 0x00400000,
82 DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS = 0x00800000,
83 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8 = 0x01000000,
84 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5 = 0x02000000,
85 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6 = 0x04000000,
87 * the following 3 have the same value
88 * repadmin.exe /bind says that
90 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3 = 0x08000000,
91 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 = 0x08000000,
92 DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT = 0x08000000,
93 DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS = 0x10000000,
94 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10 = 0x20000000,
95 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART2 = 0x40000000,
96 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART3 = 0x80000000
97 } drsuapi_SupportedExtensions;
99 typedef [bitmap32bit] bitmap {
100 DRSUAPI_SUPPORTED_EXTENSION_ADAM = 0x00000001,
101 DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 = 0x00000002,
102 DRSUAPI_SUPPORTED_EXTENSION_RECYCLE_BIN = 0x00000004
103 } drsuapi_SupportedExtensionsExt;
105 /* this is used by w2k */
106 typedef struct {
107 drsuapi_SupportedExtensions supported_extensions;
108 GUID site_guid;
109 uint32 pid;
110 } drsuapi_DsBindInfo24;
112 /* this is used by w2k3 */
113 typedef struct {
114 drsuapi_SupportedExtensions supported_extensions;
115 GUID site_guid;
116 uint32 pid;
117 uint32 repl_epoch;
118 } drsuapi_DsBindInfo28;
120 /* this is used by w2k8 */
121 typedef struct {
122 drsuapi_SupportedExtensions supported_extensions;
123 GUID site_guid;
124 uint32 pid;
125 uint32 repl_epoch;
126 drsuapi_SupportedExtensionsExt supported_extensions_ext;
127 GUID config_dn_guid;
128 } drsuapi_DsBindInfo48;
131 typedef struct {
132 [flag(NDR_REMAINING)] DATA_BLOB info;
133 } drsuapi_DsBindInfoFallBack;
136 typedef [switch_type(uint32)] union {
137 [case(24)] drsuapi_DsBindInfo24 info24;
138 [case(28)] drsuapi_DsBindInfo28 info28;
139 [case(48)] drsuapi_DsBindInfo48 info48;
140 /* [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;*/
141 } drsuapi_DsBindInfo;
143 /* the drsuapi_DsBindInfoCtr was this before
144 * typedef [flag(NDR_PAHEX)] struct {
145 * [range(1,10000)] uint32 length;
146 * [size_is(length)] uint8 data[];
147 * } drsuapi_DsBindInfo;
149 * but we don't want the caller to manually decode this blob,
150 * so we're doing it here
153 typedef struct {
154 [range(1,10000)] uint32 length;
155 [switch_is(length)] drsuapi_DsBindInfo info;
156 } drsuapi_DsBindInfoCtr;
158 /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
160 * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
162 const char *DRSUAPI_DS_BIND_GUID = "e24d201a-4fd6-11d1-a3da-0000f875ae0d";
164 * this magic guid are needed to fetch the whole tree with drsuapi_DsGetNCChanges()
165 * as administrator and this values are also used in the destination_dsa_guid field
166 * of drsuapi_DsGetNCChangesReq5/8 and the source_dsa_guid is zero.
168 const char *DRSUAPI_DS_BIND_GUID_W2K = "6abec3d1-3054-41c8-a362-5a0c5b7d5d71";
169 const char *DRSUAPI_DS_BIND_GUID_W2K3 = "6afab99c-6e26-464a-975f-f58f105218bc";
171 [public] WERROR drsuapi_DsBind(
172 [in,unique] GUID *bind_guid,
173 [in,out,unique] drsuapi_DsBindInfoCtr *bind_info,
174 [out] policy_handle *bind_handle
177 /*****************/
178 /* Function 0x01 */
179 WERROR drsuapi_DsUnbind(
180 [in,out,ref] policy_handle *bind_handle
183 /*****************/
184 /* Function 0x02 */
185 typedef struct {
186 char Data[28];
187 } DOM_SID28;
188 typedef [public,gensize] struct {
189 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags)-4)] uint32 __ndr_size;
190 [value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid;
191 GUID guid;
192 DOM_SID28 sid;
193 [value(strlen_m(dn))] uint32 __ndr_size_dn;
194 [charset(UTF16),size_is(__ndr_size_dn+1)] uint16 dn[];
195 } drsuapi_DsReplicaObjectIdentifier;
197 typedef [public] bitmap {
198 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION = 0x00000001,
199 DRSUAPI_DS_REPLICA_SYNC_WRITEABLE = 0x00000002,
200 DRSUAPI_DS_REPLICA_SYNC_PERIODIC = 0x00000004,
201 DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING = 0x00000008,
202 DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES = 0x00000010,
203 DRSUAPI_DS_REPLICA_SYNC_FULL = 0x00000020,
204 DRSUAPI_DS_REPLICA_SYNC_URGENT = 0x00000040,
205 DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD = 0x00000080,
206 DRSUAPI_DS_REPLICA_SYNC_FORCE = 0x00000100,
207 DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE = 0x00000200,
208 DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED = 0x00000400,
209 DRSUAPI_DS_REPLICA_SYNC_TWO_WAY = 0x00000800,
210 DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY = 0x00001000,
211 DRSUAPI_DS_REPLICA_SYNC_INITIAL = 0x00002000,
212 DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION = 0x00004000,
213 DRSUAPI_DS_REPLICA_SYNC_ABANDONED = 0x00008000,
214 DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS = 0x00010000,
215 DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET = 0x00020000,
216 DRSUAPI_DS_REPLICA_SYNC_REQUEUE = 0x00040000,
217 DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION = 0x00080000,
218 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA = 0x00100000,
219 DRSUAPI_DS_REPLICA_SYNC_CRITICAL = 0x00200000,
220 DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS = 0x00400000,
221 DRSUAPI_DS_REPLICA_SYNC_PREEMPTED = 0x00800000
222 } drsuapi_DsReplicaSyncOptions;
224 typedef struct {
225 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
226 GUID source_dsa_guid;
227 [charset(DOS),string] uint8 *src_dsa_dns_name; /* I assume this is related to the repsFromTo1OtherInfo dns_name */
228 drsuapi_DrsOptions options;
229 } drsuapi_DsReplicaSyncRequest1;
231 typedef [switch_type(uint32)] union {
232 [case(1)] drsuapi_DsReplicaSyncRequest1 req1;
233 } drsuapi_DsReplicaSyncRequest;
235 WERROR drsuapi_DsReplicaSync(
236 [in,ref] policy_handle *bind_handle,
237 [in] uint32 level,
238 [in,switch_is(level)] drsuapi_DsReplicaSyncRequest *req
241 /*****************/
242 /* Function 0x03 */
243 typedef struct {
244 uint64 usn1;
245 uint64 usn2;
246 uint64 usn3;
247 } drsuapi_DsGetNCChangesUsnTriple;
249 typedef struct {
250 GUID source_dsa_invocation_id;
251 uint64 highest_usn;
252 } drsuapi_DsReplicaCursor;
254 typedef struct {
255 uint32 u1;
256 uint32 u2;
257 [range(0,0x100000)] uint32 count;
258 uint32 u3;
259 [size_is(count)] drsuapi_DsReplicaCursor array[];
260 } drsuapi_DsReplicaCursor05Ctr;
262 typedef struct {
263 GUID guid1;
264 GUID guid2;
265 [ref] drsuapi_DsReplicaObjectIdentifier *sync_req_info1;
266 drsuapi_DsGetNCChangesUsnTriple usn1;
267 drsuapi_DsReplicaCursor05Ctr *coursor;
268 uint32 unknown1;
269 uint32 unknown2;
270 uint32 unknown3;
271 uint32 unknown4;
272 uint64 h1;
273 } drsuapi_DsGetNCChangesRequest5;
275 typedef [flag(NDR_PAHEX)] struct {
276 [range(0,10000)] uint32 length;
277 [size_is(length)] uint8 *byte_array[];
278 } drsuapi_DsGetNCChangesRequest_Ctr14;
280 typedef struct {
281 uint32 unknown1;
282 drsuapi_DsGetNCChangesRequest_Ctr14 data;
283 } drsuapi_DsGetNCChangesRequest_Ctr13;
285 typedef struct {
286 [range(0,0x100000)] uint32 count;
287 [size_is(count)] drsuapi_DsGetNCChangesRequest_Ctr13 *array[];
288 } drsuapi_DsGetNCChangesRequest_Ctr12;
290 typedef struct {
291 GUID guid1;
292 GUID guid2;
293 [ref] drsuapi_DsReplicaObjectIdentifier *sync_req_info1;
294 drsuapi_DsGetNCChangesUsnTriple usn1;
295 drsuapi_DsReplicaCursor05Ctr *coursor;
296 uint32 unknown1;
297 uint32 unknown2;
298 uint32 unknown3;
299 uint32 unknown4;
300 uint64 h1;
301 uint32 unique_ptr1;
302 uint32 unique_ptr2;
303 drsuapi_DsGetNCChangesRequest_Ctr12 ctr12;
304 } drsuapi_DsGetNCChangesRequest8;
306 typedef [switch_type(uint32)] union {
307 [case(5)] drsuapi_DsGetNCChangesRequest5 req5;
308 [case(8)] drsuapi_DsGetNCChangesRequest8 req8;
309 } drsuapi_DsGetNCChangesRequest;
311 typedef struct {
312 drsuapi_DsReplicaCursor coursor;
313 NTTIME_1sec time1;
314 } drsuapi_DsReplicaCursorEx;
316 typedef struct {
317 uint32 u1;
318 uint32 u2;
319 [range(0,0x100000)] uint32 count;
320 uint32 u3;
321 [size_is(count)] drsuapi_DsReplicaCursorEx array[];
322 } drsuapi_DsReplicaCursorEx05Ctr;
324 typedef struct {
325 GUID guid1;
326 GUID guid2;
327 drsuapi_DsReplicaObjectIdentifier *sync_req_info1;
328 drsuapi_DsGetNCChangesUsnTriple usn1;
329 drsuapi_DsGetNCChangesUsnTriple usn2;
330 drsuapi_DsReplicaCursorEx05Ctr *coursor_ex;
331 drsuapi_DsGetNCChangesRequest_Ctr12 ctr12;
332 uint32 u1[3];
333 uint32 ptr1;
334 uint32 u2[3];
335 uint32 len1;
336 uint32 array_ptr1;
337 uint32 u3;
338 } drsuapi_DsGetNCChangesCtr6;
340 /* typedef struct {
341 } drsuapi_DsGetNCChangesCtr7;
343 typedef [switch_type(uint32)] union {
344 [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6;
345 /* [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7;*/
346 } drsuapi_DsGetNCChangesCtr;
348 WERROR drsuapi_DsGetNCChanges(
349 [in,ref] policy_handle *bind_handle,
350 [in] uint32 level,
351 [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req,
352 [out,ref] uint32 *level_out,
353 [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr
356 /*****************/
357 /* Function 0x04 */
358 typedef bitmap {
359 DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION = 0x00000001,
360 DRSUAPI_DS_REPLICA_UPDATE_GETCHG_CHECK = 0x00000002,
361 DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE = 0x00000004,
362 DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE = 0x00000008,
363 DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE = 0x00000010
364 } drsuapi_DsReplicaUpdateRefsOptions;
366 typedef struct {
367 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
368 [ref,charset(DOS),string] uint8 *dest_dsa_dns_name;
369 GUID dest_dsa_guid;
370 drsuapi_DsReplicaUpdateRefsOptions options;
371 } drsuapi_DsReplicaUpdateRefsRequest1;
373 typedef [switch_type(uint32)] union {
374 [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1;
375 } drsuapi_DsReplicaUpdateRefsRequest;
377 WERROR drsuapi_DsReplicaUpdateRefs(
378 [in,ref] policy_handle *bind_handle,
379 [in] uint32 level,
380 [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req
383 /*****************/
384 /* Function 0x05 */
385 typedef bitmap {
386 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,
387 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002
388 /* TODO ... */
389 } drsuapi_DsReplicaAddOptions;
391 WERROR DRSUAPI_REPLICA_ADD();
393 /*****************/
394 /* Function 0x06 */
395 typedef bitmap {
396 DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION = 0x00000001,
397 DRSUAPI_DS_REPLICA_DELETE_WRITEABLE = 0x00000002
398 /* TODO ... */
399 } drsuapi_DsReplicaDeleteOptions;
401 WERROR DRSUAPI_REPLICA_DEL();
403 /*****************/
404 /* Function 0x07 */
405 typedef bitmap {
406 DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION = 0x00000001,
407 DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE = 0x00000002
408 } drsuapi_DsReplicaModifyOptions;
410 WERROR DRSUAPI_REPLICA_MODIFY();
412 /*****************/
413 /* Function 0x08 */
414 WERROR DRSUAPI_VERIFY_NAMES();
416 /*****************/
417 /* Function 0x09 */
418 WERROR DRSUAPI_GET_MEMBERSHIPS();
420 /*****************/
421 /* Function 0x0a */
422 WERROR DRSUAPI_INTER_DOMAIN_MOVE();
424 /*****************/
425 /* Function 0x0b */
426 WERROR DRSUAPI_GET_NT4_CHANGELOG();
428 /*****************/
429 /* Function 0x0c */
430 typedef [v1_enum] enum {
431 DRSUAPI_DS_NAME_STATUS_OK = 0,
432 DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR = 1,
433 DRSUAPI_DS_NAME_STATUS_NOT_FOUND = 2,
434 DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE = 3,
435 DRSUAPI_DS_NAME_STATUS_NO_MAPPING = 4,
436 DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY = 5,
437 DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING = 6,
438 DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL = 7
439 } drsuapi_DsNameStatus;
441 typedef [v1_enum] enum {
442 DRSUAPI_DS_NAME_FLAG_NO_FLAGS = 0x0,
443 DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,
444 DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC = 0x2,
445 DRSUAPI_DS_NAME_FLAG_GCVERIFY = 0x4,
446 DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL = 0x8
447 } drsuapi_DsNameFlags;
449 typedef [v1_enum] enum {
450 DRSUAPI_DS_NAME_FORMAT_UKNOWN = 0,
451 DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 1,
452 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 2,
453 DRSUAPI_DS_NAME_FORMAT_DISPLAY = 3,
454 DRSUAPI_DS_NAME_FORMAT_GUID = 6,
455 DRSUAPI_DS_NAME_FORMAT_CANONICAL = 7,
456 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 8,
457 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 9,
458 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 10,
459 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 11,
460 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 12
461 } drsuapi_DsNameFormat;
463 typedef struct {
464 [string,charset(UTF16)] uint16 *str;
465 } drsuapi_DsNameString;
467 typedef struct {
468 uint32 unknown1; /* 0x000004e4 */
469 uint32 unknown2; /* 0x00000407 */
470 drsuapi_DsNameFlags format_flags;
471 drsuapi_DsNameFormat format_offered;
472 drsuapi_DsNameFormat format_desired;
473 [range(1,10000)] uint32 count;
474 [size_is(count)] drsuapi_DsNameString *names[];
475 } drsuapi_DsNameRequest1;
477 typedef [switch_type(uint32)] union {
478 [case(1)] drsuapi_DsNameRequest1 req1;
479 } drsuapi_DsNameRequest;
481 typedef struct {
482 drsuapi_DsNameStatus status;
483 [charset(UTF16),string] uint16 *dns_domain_name;
484 [charset(UTF16),string] uint16 *result_name;
485 } drsuapi_DsNameInfo1;
487 typedef struct {
488 uint32 count;
489 [size_is(count)] drsuapi_DsNameInfo1 *array[];
490 } drsuapi_DsNameCtr1;
492 typedef [switch_type(uint32)] union {
493 [case(1)] drsuapi_DsNameCtr1 *ctr1;
494 } drsuapi_DsNameCtr;
496 WERROR drsuapi_DsCrackNames(
497 [in,ref] policy_handle *bind_handle,
498 [in] uint32 level,
499 [in,ref,switch_is(level)] drsuapi_DsNameRequest *req,
500 [out,ref] uint32 *level_out,
501 [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr
504 /*****************/
505 /* Function 0x0d */
506 typedef [v1_enum] enum {
507 DRSUAPI_DS_SPN_OPERATION_ADD = 0,
508 DRSUAPI_DS_SPN_OPERATION_REPLACE= 1,
509 DRSUAPI_DS_SPN_OPERATION_DELETE = 2
510 } drsuapi_DsSpnOperation;
512 typedef struct {
513 drsuapi_DsSpnOperation operation;
514 uint32 unknown1;
515 [charset(UTF16),string] uint16 *object_dn;
516 [range(0,10000)] uint32 count;
517 [size_is(count)] drsuapi_DsNameString *spn_names;
518 } drsuapi_DsWriteAccountSpnRequest1;
520 typedef [switch_type(uint32)] union {
521 [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1;
522 } drsuapi_DsWriteAccountSpnRequest;
524 typedef struct {
525 WERROR status;
526 } drsuapi_DsWriteAccountSpnResult1;
528 typedef [switch_type(uint32)] union {
529 [case(1)] drsuapi_DsWriteAccountSpnResult1 res1;
530 } drsuapi_DsWriteAccountSpnResult;
532 WERROR drsuapi_DsWriteAccountSpn(
533 [in,ref] policy_handle *bind_handle,
534 [in] uint32 level,
535 [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req,
536 [out,ref] uint32 *level_out,
537 [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res
540 /*****************/
541 /* Function 0x0e */
542 WERROR DRSUAPI_REMOVE_DS_SERVER();
544 /*****************/
545 /* Function 0x0f */
546 WERROR DRSUAPI_REMOVE_DS_DOMAIN();
548 /*****************/
549 /* Function 0x10 */
550 typedef struct {
551 [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */
552 int32 level; /* specifies the switch level for the request */
553 } drsuapi_DsGetDCInfoRequest1;
555 typedef [switch_type(uint32)] union {
556 [case(1)] drsuapi_DsGetDCInfoRequest1 req1;
557 } drsuapi_DsGetDCInfoRequest;
559 typedef struct {
560 [charset(UTF16),string] uint16 *netbios_name;
561 [charset(UTF16),string] uint16 *dns_name;
562 [charset(UTF16),string] uint16 *site_name;
563 [charset(UTF16),string] uint16 *computer_dn;
564 [charset(UTF16),string] uint16 *server_dn;
565 uint32 is_pdc;
566 uint32 is_enabled;
567 } drsuapi_DsGetDCInfo1;
569 typedef struct {
570 [range(0,10000)] uint32 count;
571 [size_is(count)] drsuapi_DsGetDCInfo1 *array[];
572 } drsuapi_DsGetDCInfoCtr1;
574 typedef struct {
575 [charset(UTF16),string] uint16 *netbios_name;
576 [charset(UTF16),string] uint16 *dns_name;
577 [charset(UTF16),string] uint16 *site_name;
578 [charset(UTF16),string] uint16 *site_dn;
579 [charset(UTF16),string] uint16 *computer_dn;
580 [charset(UTF16),string] uint16 *server_dn;
581 [charset(UTF16),string] uint16 *ntds_dn;
582 uint32 is_pdc;
583 uint32 is_enabled;
584 uint32 is_gc;
585 GUID site_guid;
586 GUID computer_guid;
587 GUID server_guid;
588 GUID ntds_guid;
589 } drsuapi_DsGetDCInfo2;
591 typedef struct {
592 [range(0,10000)] uint32 count;
593 [size_is(count)] drsuapi_DsGetDCInfo2 *array[];
594 } drsuapi_DsGetDCInfoCtr2;
596 typedef struct {
597 uint32 unknown1;
598 uint32 unknown2;
599 uint32 unknown3;
600 uint32 unknown4;
601 uint32 unknown5;
602 uint32 unknown6;
603 [charset(UTF16),string] uint16 *server_nt4_account;
604 } drsuapi_DsGetDCInfo01;
606 typedef struct {
607 [range(0,10000)] uint32 count;
608 [size_is(count)] drsuapi_DsGetDCInfo01 *array[];
609 } drsuapi_DsGetDCInfoCtr01;
611 typedef [v1_enum] enum {
612 DRSUAPI_DC_INFO_CTR_1 = 1,
613 DRSUAPI_DC_INFO_CTR_2 = 2,
614 DRSUAPI_DC_INFO_CTR_01 = -1
615 } drsuapi_DsGetDCInfoCtrLevels;
617 typedef [switch_type(uint32)] union {
618 [case(DRSUAPI_DC_INFO_CTR_1)] drsuapi_DsGetDCInfoCtr1 ctr1;
619 [case(DRSUAPI_DC_INFO_CTR_2)] drsuapi_DsGetDCInfoCtr2 ctr2;
620 [case(DRSUAPI_DC_INFO_CTR_01)] drsuapi_DsGetDCInfoCtr01 ctr01;
621 } drsuapi_DsGetDCInfoCtr;
623 WERROR drsuapi_DsGetDomainControllerInfo(
624 [in,ref] policy_handle *bind_handle,
625 [in] uint32 level,
626 [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req,
627 [out,ref] uint32 *level_out,
628 [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr
631 /*****************/
632 /* Function 0x11 */
633 WERROR drsuapi_DsAddEntry();
635 /*****************/
636 /* Function 0x12 */
637 typedef bitmap {
638 DRSUAPI_DS_EXECUTE_KCC_ASYNCHRONOUS_OPERATION = 0x00000001,
639 DRSUAPI_DS_EXECUTE_KCC_DAMPED = 0x00000002
640 } drsuapi_DsExecuteKCCFlags;
642 typedef struct {
643 uint32 taskID;
644 drsuapi_DsExecuteKCCFlags flags;
645 } drsuapi_DsExecuteKCC1;
647 typedef [switch_type(uint32)] union {
648 [case(1)] drsuapi_DsExecuteKCC1 ctr1;
649 } drsuapi_DsExecuteKCCRequest;
651 WERROR drsuapi_DsExecuteKCC(
652 [in] policy_handle *bind_handle,
653 [in] uint32 level,
654 [in, ref, switch_is(level)] drsuapi_DsExecuteKCCRequest *req
657 /*****************/
658 /* Function 0x13 */
659 typedef [v1_enum] enum {
660 DRSUAPI_DS_REPLICA_GET_INFO = 1,
661 DRSUAPI_DS_REPLICA_GET_INFO2 = 2
662 } drsuapi_DsReplicaGetInfoLevel;
664 typedef [v1_enum] enum {
665 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS = 0,
666 DRSUAPI_DS_REPLICA_INFO_CURSORS = 1,
667 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA = 2,
668 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES = 3,
669 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES = 4,
670 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS = 5,
671 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA = 6,
672 DRSUAPI_DS_REPLICA_INFO_CURSORS2 = 7,
673 DRSUAPI_DS_REPLICA_INFO_CURSORS3 = 8,
674 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 = 9,
675 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 = 10,
676 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02 = -2,
677 DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04 = -4,
678 DRSUAPI_DS_REPLICA_INFO_CURSURS05 = -5,
679 DRSUAPI_DS_REPLICA_INFO_06 = -6
680 } drsuapi_DsReplicaInfoType;
682 typedef struct {
683 drsuapi_DsReplicaInfoType info_type;
684 [charset(UTF16),string] uint16 *object_dn;
685 GUID guid1;
686 } drsuapi_DsReplicaGetInfoRequest1;
688 typedef struct {
689 drsuapi_DsReplicaInfoType info_type;
690 [charset(UTF16),string] uint16 *object_dn;
691 GUID guid1;
692 uint32 unknown1;
693 [charset(UTF16),string] uint16 *string1;
694 [charset(UTF16),string] uint16 *string2;
695 uint32 unknown2;
696 } drsuapi_DsReplicaGetInfoRequest2;
698 typedef [switch_type(drsuapi_DsReplicaGetInfoLevel)] union {
699 [case(DRSUAPI_DS_REPLICA_GET_INFO)] drsuapi_DsReplicaGetInfoRequest1 req1;
700 [case(DRSUAPI_DS_REPLICA_GET_INFO2)] drsuapi_DsReplicaGetInfoRequest2 req2;
701 } drsuapi_DsReplicaGetInfoRequest;
703 typedef struct {
704 [charset(UTF16),string] uint16 *naming_context_dn;
705 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
706 [charset(UTF16),string] uint16 *source_dsa_address;
707 [charset(UTF16),string] uint16 *transport_obj_dn;
708 uint32 replica_flags;
709 uint32 reserved;
710 GUID naming_context_obj_guid;
711 GUID source_dsa_obj_guid;
712 GUID source_dsa_invocation_id;
713 GUID transport_obj_guid;
714 uint64 tmp_highest_usn;
715 uint64 highest_usn;
716 NTTIME last_success;
717 NTTIME last_attempt;
718 WERROR result_last_attempt;
719 uint32 consecutive_sync_failures;
720 } drsuapi_DsReplicaNeighbour;
722 typedef struct {
723 uint32 count;
724 uint32 reserved;
725 [size_is(count)] drsuapi_DsReplicaNeighbour array[];
726 } drsuapi_DsReplicaNeighbourCtr;
728 typedef struct {
729 uint32 count;
730 uint32 reserved;
731 [size_is(count)] drsuapi_DsReplicaCursor array[];
732 } drsuapi_DsReplicaCursorCtr;
734 typedef struct {
735 [charset(UTF16),string] uint16 *attribute_name;
736 uint32 version;
737 NTTIME originating_last_changed;
738 GUID originating_dsa_invocation_id;
739 uint64 originating_usn;
740 uint64 local_usn;
741 } drsuapi_DsReplicaObjMetaData;
743 typedef struct {
744 uint32 count;
745 uint32 reserved;
746 [size_is(count)] drsuapi_DsReplicaObjMetaData array[];
747 } drsuapi_DsReplicaObjMetaDataCtr;
749 typedef struct {
750 [charset(UTF16),string] uint16 *dsa_obj_dn;
751 GUID dsa_obj_guid;
752 NTTIME first_failure;
753 uint32 num_failures;
754 WERROR last_result;
755 } drsuapi_DsReplicaKccDsaFailure;
757 typedef struct {
758 uint32 count;
759 uint32 reserved;
760 [size_is(count)] drsuapi_DsReplicaKccDsaFailure array[];
761 } drsuapi_DsReplicaKccDsaFailuresCtr;
763 typedef enum {
764 DRSUAPI_DS_REPLICA_OP_TYPE_SYNC = 0,
765 DRSUAPI_DS_REPLICA_OP_TYPE_ADD = 1,
766 DRSUAPI_DS_REPLICA_OP_TYPE_DELETE = 2,
767 DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY = 3,
768 DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS = 4
769 } drsuapi_DsReplicaOpType;
771 typedef [switch_type(drsuapi_DsReplicaOpType)] union {
772 [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] drsuapi_DsReplicaSyncOptions sync;
773 [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] drsuapi_DsReplicaAddOptions add;
774 [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions delete;
775 [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] drsuapi_DsReplicaModifyOptions modify;
776 [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] drsuapi_DsReplicaUpdateRefsOptions update_refs;
777 [default] uint32 unknown;
778 } drsuapi_DsRplicaOpOptions;
780 typedef struct {
781 NTTIME operation_start;
782 uint32 serial_num; /* unique till reboot */
783 uint32 priority;
784 drsuapi_DsReplicaOpType operation_type;
785 [switch_is(operation_type)] drsuapi_DsRplicaOpOptions options;
786 [charset(UTF16),string] uint16 *nc_dn;
787 [charset(UTF16),string] uint16 *remote_dsa_obj_dn;
788 [charset(UTF16),string] uint16 *remote_dsa_address;
789 GUID nc_obj_guid;
790 GUID remote_dsa_obj_guid;
791 } drsuapi_DsReplicaOp;
793 typedef struct {
794 NTTIME time;
795 uint32 count;
796 [size_is(count)] drsuapi_DsReplicaOp array[];
797 } drsuapi_DsReplicaOpCtr;
799 typedef struct {
800 [charset(UTF16),string] uint16 *attribute_name;
801 [charset(UTF16),string] uint16 *object_dn;
802 uint32 value_length;
803 [size_is(value_length)] uint8 *value[];
804 NTTIME deleted;
805 NTTIME created;
806 uint32 version;
807 NTTIME originating_last_changed;
808 GUID originating_dsa_invocation_id;
809 uint64 originating_usn;
810 uint64 local_usn;
811 } drsuapi_DsReplicaAttrValMetaData;
813 typedef struct {
814 uint32 count;
815 int32 enumeration_context;
816 [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[];
817 } drsuapi_DsReplicaAttrValMetaDataCtr;
819 typedef struct {
820 GUID source_dsa_invocation_id;
821 uint64 highest_usn;
822 NTTIME last_sync_success;
823 } drsuapi_DsReplicaCursor2;
825 typedef struct {
826 uint32 count;
827 int32 enumeration_context;
828 [size_is(count)] drsuapi_DsReplicaCursor2 array[];
829 } drsuapi_DsReplicaCursor2Ctr;
831 typedef struct {
832 GUID source_dsa_invocation_id;
833 uint64 highest_usn;
834 NTTIME last_sync_success;
835 [charset(UTF16),string] uint16 *source_dsa_obj_dn;
836 } drsuapi_DsReplicaCursor3;
838 typedef struct {
839 uint32 count;
840 int32 enumeration_context;
841 [size_is(count)] drsuapi_DsReplicaCursor3 array[];
842 } drsuapi_DsReplicaCursor3Ctr;
844 typedef struct {
845 [charset(UTF16),string] uint16 *attribute_name;
846 uint32 version;
847 NTTIME originating_last_changed;
848 GUID originating_dsa_invocation_id;
849 uint64 originating_usn;
850 uint64 local_usn;
851 [charset(UTF16),string] uint16 *originating_dsa_obj_dn;
852 } drsuapi_DsReplicaObjMetaData2;
854 typedef struct {
855 uint32 count;
856 int32 enumeration_context;
857 [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[];
858 } drsuapi_DsReplicaObjMetaData2Ctr;
860 typedef struct {
861 [charset(UTF16),string] uint16 *attribute_name;
862 [charset(UTF16),string] uint16 *object_dn;
863 uint32 value_length;
864 [size_is(value_length)] uint8 *value[];
865 NTTIME deleted;
866 NTTIME created;
867 uint32 version;
868 NTTIME originating_last_changed;
869 GUID originating_dsa_invocation_id;
870 uint64 originating_usn;
871 uint64 local_usn;
872 [charset(UTF16),string] uint16 *originating_dsa_obj_dn;
873 } drsuapi_DsReplicaAttrValMetaData2;
875 typedef struct {
876 uint32 count;
877 int32 enumeration_context;
878 [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[];
879 } drsuapi_DsReplicaAttrValMetaData2Ctr;
881 typedef struct {
882 uint64 u1; /* session number? */
883 uint32 u2;
884 uint32 u3;
885 GUID bind_guid;
886 NTTIME_1sec bind_time;
887 uint32 u4; /* flags? */
888 uint32 u5;
889 } drsuapi_DsReplicaConnection04;
891 typedef struct {
892 [range(0,10000)] uint32 count;
893 uint32 reserved;
894 [size_is(count)] drsuapi_DsReplicaConnection04 array[];
895 } drsuapi_DsReplicaConnection04Ctr;
897 typedef struct {
898 [charset(UTF16),string] uint16 *str1;
899 uint32 u1;
900 uint32 u2;
901 uint32 u3;
902 uint32 u4;
903 uint32 u5;
904 uint64 u6;
905 uint32 u7;
906 } drsuapi_DsReplica06;
908 typedef struct {
909 [range(0,256)] uint32 count;
910 uint32 reserved;
911 [size_is(count)] drsuapi_DsReplica06 array[];
912 } drsuapi_DsReplica06Ctr;
914 typedef [switch_type(drsuapi_DsReplicaInfoType)] union {
915 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] drsuapi_DsReplicaNeighbourCtr *neighbours;
916 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] drsuapi_DsReplicaCursorCtr *coursors;
917 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] drsuapi_DsReplicaObjMetaDataCtr *objmetadata;
918 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;
919 [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;
920 [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] drsuapi_DsReplicaOpCtr *pendingops;
921 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;
922 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] drsuapi_DsReplicaCursor2Ctr *coursors2;
923 [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] drsuapi_DsReplicaCursor3Ctr *coursors3;
924 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;
925 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;
926 [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02)] drsuapi_DsReplicaNeighbourCtr *neighbours02;
927 [case(DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04)] drsuapi_DsReplicaConnection04Ctr *connections04;
928 [case(DRSUAPI_DS_REPLICA_INFO_CURSURS05)] drsuapi_DsReplicaCursor05Ctr *coursors05;
929 [case(DRSUAPI_DS_REPLICA_INFO_06)] drsuapi_DsReplica06Ctr *i06;
930 } drsuapi_DsReplicaInfo;
932 WERROR drsuapi_DsReplicaGetInfo(
933 [in,ref] policy_handle *bind_handle,
934 [in] drsuapi_DsReplicaGetInfoLevel level,
935 [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req,
936 [out,ref] drsuapi_DsReplicaInfoType *info_type,
937 [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info
940 /*****************/
941 /* Function 0x14 */
942 WERROR DRSUAPI_ADD_SID_HISTORY();
944 /*****************/
945 /* Function 0x15 */
946 WERROR DRSUAPI_GET_MEMBERSHIPS2();
948 /*****************/
949 /* Function 0x16 */
950 WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS();
952 /*****************/
953 /* Function 0x17 */
954 WERROR DRSUAPI_GET_OBJECT_EXISTENCE();
956 /*****************/
957 /* Function 0x18 */
958 WERROR DRSUAPI_QUERY_SITES_BY_COST();