source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ntdsapi.h@ 1194

Last change on this file since 1194 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 40.3 KB
Line 
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _NTDSAPI_H_
7#define _NTDSAPI_H_
8
9#include <_mingw_unicode.h>
10
11#include <schedule.h>
12#include <rpc.h>
13
14#if !defined(_NTDSAPI_)
15#define NTDSAPI DECLSPEC_IMPORT
16#if !defined(_NTDSAPI_POSTXP_ASLIB_)
17#define NTDSAPI_POSTXP DECLSPEC_IMPORT
18#else
19#define NTDSAPI_POSTXP
20#endif
21#else
22#define NTDSAPI
23#define NTDSAPI_POSTXP
24#endif
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define DS_BEHAVIOR_WIN2000 0
31#define DS_BEHAVIOR_WIN2003_WITH_MIXED_DOMAINS 1
32#define DS_BEHAVIOR_WIN2003 2
33
34#define DS_DEFAULT_LOCALE (MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT))
35#define DS_DEFAULT_LOCALE_COMPARE_FLAGS (NORM_IGNORECASE | NORM_IGNOREKANATYPE | NORM_IGNORENONSPACE | NORM_IGNOREWIDTH | SORT_STRINGSORT)
36
37#define DS_SYNCED_EVENT_NAME "NTDSInitialSyncsCompleted"
38#define DS_SYNCED_EVENT_NAME_W L"NTDSInitialSyncsCompleted"
39
40#ifndef _DS_CONTROL_BITS_DEFINED_
41#define _DS_CONTROL_BITS_DEFINED_
42#define ACTRL_DS_OPEN 0x00000000
43#define ACTRL_DS_CREATE_CHILD 0x00000001
44#define ACTRL_DS_DELETE_CHILD 0x00000002
45#define ACTRL_DS_LIST 0x00000004
46#define ACTRL_DS_SELF 0x00000008
47#define ACTRL_DS_READ_PROP 0x00000010
48#define ACTRL_DS_WRITE_PROP 0x00000020
49#define ACTRL_DS_DELETE_TREE 0x00000040
50#define ACTRL_DS_LIST_OBJECT 0x00000080
51#define ACTRL_DS_CONTROL_ACCESS 0x00000100
52
53#define DS_GENERIC_READ ((STANDARD_RIGHTS_READ) | (ACTRL_DS_LIST) | (ACTRL_DS_READ_PROP) | (ACTRL_DS_LIST_OBJECT))
54#define DS_GENERIC_EXECUTE ((STANDARD_RIGHTS_EXECUTE) | (ACTRL_DS_LIST))
55#define DS_GENERIC_WRITE ((STANDARD_RIGHTS_WRITE) | (ACTRL_DS_SELF) | (ACTRL_DS_WRITE_PROP))
56#define DS_GENERIC_ALL ((STANDARD_RIGHTS_REQUIRED) | (ACTRL_DS_CREATE_CHILD) | (ACTRL_DS_DELETE_CHILD) | (ACTRL_DS_DELETE_TREE) | (ACTRL_DS_READ_PROP) | (ACTRL_DS_WRITE_PROP) | (ACTRL_DS_LIST) | (ACTRL_DS_LIST_OBJECT) | (ACTRL_DS_CONTROL_ACCESS) | (ACTRL_DS_SELF))
57#endif
58
59 typedef enum {
60 DS_UNKNOWN_NAME = 0,DS_FQDN_1779_NAME = 1,DS_NT4_ACCOUNT_NAME = 2,DS_DISPLAY_NAME = 3,DS_UNIQUE_ID_NAME = 6,DS_CANONICAL_NAME = 7,
61 DS_USER_PRINCIPAL_NAME = 8,DS_CANONICAL_NAME_EX = 9,DS_SERVICE_PRINCIPAL_NAME = 10,DS_SID_OR_SID_HISTORY_NAME = 11,DS_DNS_DOMAIN_NAME = 12
62 } DS_NAME_FORMAT;
63
64#define DS_DOMAIN_SIMPLE_NAME DS_USER_PRINCIPAL_NAME
65#define DS_ENTERPRISE_SIMPLE_NAME DS_USER_PRINCIPAL_NAME
66
67 typedef enum {
68 DS_NAME_NO_FLAGS = 0x0,DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,DS_NAME_FLAG_EVAL_AT_DC = 0x2,DS_NAME_FLAG_GCVERIFY = 0x4,
69 DS_NAME_FLAG_TRUST_REFERRAL = 0x8
70 } DS_NAME_FLAGS;
71
72 typedef enum {
73 DS_NAME_NO_ERROR = 0,DS_NAME_ERROR_RESOLVING = 1,DS_NAME_ERROR_NOT_FOUND = 2,DS_NAME_ERROR_NOT_UNIQUE = 3,DS_NAME_ERROR_NO_MAPPING = 4,
74 DS_NAME_ERROR_DOMAIN_ONLY = 5,DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING = 6,DS_NAME_ERROR_TRUST_REFERRAL = 7
75 } DS_NAME_ERROR;
76
77#define DS_NAME_LEGAL_FLAGS (DS_NAME_FLAG_SYNTACTICAL_ONLY)
78
79 typedef enum {
80 DS_SPN_DNS_HOST = 0,DS_SPN_DN_HOST = 1,DS_SPN_NB_HOST = 2,DS_SPN_DOMAIN = 3,DS_SPN_NB_DOMAIN = 4,DS_SPN_SERVICE = 5
81 } DS_SPN_NAME_TYPE;
82
83 typedef enum {
84 DS_SPN_ADD_SPN_OP = 0,DS_SPN_REPLACE_SPN_OP = 1,DS_SPN_DELETE_SPN_OP = 2
85 } DS_SPN_WRITE_OP;
86
87 typedef struct {
88 DWORD status;
89 LPSTR pDomain;
90 LPSTR pName;
91 } DS_NAME_RESULT_ITEMA,*PDS_NAME_RESULT_ITEMA;
92
93 typedef struct {
94 DWORD cItems;
95 PDS_NAME_RESULT_ITEMA rItems;
96 } DS_NAME_RESULTA,*PDS_NAME_RESULTA;
97
98 typedef struct {
99 DWORD status;
100 LPWSTR pDomain;
101 LPWSTR pName;
102 } DS_NAME_RESULT_ITEMW,*PDS_NAME_RESULT_ITEMW;
103
104 typedef struct {
105 DWORD cItems;
106 PDS_NAME_RESULT_ITEMW rItems;
107 } DS_NAME_RESULTW,*PDS_NAME_RESULTW;
108
109#define DS_NAME_RESULT __MINGW_NAME_AW(DS_NAME_RESULT)
110#define PDS_NAME_RESULT __MINGW_NAME_AW(PDS_NAME_RESULT)
111#define DS_NAME_RESULT_ITEM __MINGW_NAME_AW(DS_NAME_RESULT_ITEM)
112#define PDS_NAME_RESULT_ITEM __MINGW_NAME_AW(PDS_NAME_RESULT_ITEM)
113
114#define NTDSAPI_BIND_ALLOW_DELEGATION (0x00000001)
115
116#define DS_REPSYNC_ASYNCHRONOUS_OPERATION 0x00000001
117#define DS_REPSYNC_WRITEABLE 0x00000002
118#define DS_REPSYNC_PERIODIC 0x00000004
119#define DS_REPSYNC_INTERSITE_MESSAGING 0x00000008
120#define DS_REPSYNC_ALL_SOURCES 0x00000010
121#define DS_REPSYNC_FULL 0x00000020
122#define DS_REPSYNC_URGENT 0x00000040
123#define DS_REPSYNC_NO_DISCARD 0x00000080
124#define DS_REPSYNC_FORCE 0x00000100
125#define DS_REPSYNC_ADD_REFERENCE 0x00000200
126#define DS_REPSYNC_NEVER_COMPLETED 0x00000400
127#define DS_REPSYNC_TWO_WAY 0x00000800
128#define DS_REPSYNC_NEVER_NOTIFY 0x00001000
129#define DS_REPSYNC_INITIAL 0x00002000
130#define DS_REPSYNC_USE_COMPRESSION 0x00004000
131#define DS_REPSYNC_ABANDONED 0x00008000
132#define DS_REPSYNC_INITIAL_IN_PROGRESS 0x00010000
133#define DS_REPSYNC_PARTIAL_ATTRIBUTE_SET 0x00020000
134#define DS_REPSYNC_REQUEUE 0x00040000
135#define DS_REPSYNC_NOTIFICATION 0x00080000
136#define DS_REPSYNC_ASYNCHRONOUS_REPLICA 0x00100000
137#define DS_REPSYNC_CRITICAL 0x00200000
138#define DS_REPSYNC_FULL_IN_PROGRESS 0x00400000
139#define DS_REPSYNC_PREEMPTED 0x00800000
140
141#define DS_REPADD_ASYNCHRONOUS_OPERATION 0x00000001
142#define DS_REPADD_WRITEABLE 0x00000002
143#define DS_REPADD_INITIAL 0x00000004
144#define DS_REPADD_PERIODIC 0x00000008
145#define DS_REPADD_INTERSITE_MESSAGING 0x00000010
146#define DS_REPADD_ASYNCHRONOUS_REPLICA 0x00000020
147#define DS_REPADD_DISABLE_NOTIFICATION 0x00000040
148#define DS_REPADD_DISABLE_PERIODIC 0x00000080
149#define DS_REPADD_USE_COMPRESSION 0x00000100
150#define DS_REPADD_NEVER_NOTIFY 0x00000200
151#define DS_REPADD_TWO_WAY 0x00000400
152#define DS_REPADD_CRITICAL 0x00000800
153
154#define DS_REPDEL_ASYNCHRONOUS_OPERATION 0x00000001
155#define DS_REPDEL_WRITEABLE 0x00000002
156#define DS_REPDEL_INTERSITE_MESSAGING 0x00000004
157#define DS_REPDEL_IGNORE_ERRORS 0x00000008
158#define DS_REPDEL_LOCAL_ONLY 0x00000010
159#define DS_REPDEL_NO_SOURCE 0x00000020
160#define DS_REPDEL_REF_OK 0x00000040
161
162#define DS_REPMOD_ASYNCHRONOUS_OPERATION 0x00000001
163#define DS_REPMOD_WRITEABLE 0x00000002
164#define DS_REPMOD_UPDATE_FLAGS 0x00000001
165#define DS_REPMOD_UPDATE_ADDRESS 0x00000002
166#define DS_REPMOD_UPDATE_SCHEDULE 0x00000004
167#define DS_REPMOD_UPDATE_RESULT 0x00000008
168#define DS_REPMOD_UPDATE_TRANSPORT 0x00000010
169
170#define DS_REPUPD_ASYNCHRONOUS_OPERATION 0x00000001
171#define DS_REPUPD_WRITEABLE 0x00000002
172#define DS_REPUPD_ADD_REFERENCE 0x00000004
173#define DS_REPUPD_DELETE_REFERENCE 0x00000008
174
175#define DS_INSTANCETYPE_IS_NC_HEAD 0x00000001
176#define DS_INSTANCETYPE_NC_IS_WRITEABLE 0x00000004
177#define DS_INSTANCETYPE_NC_COMING 0x00000010
178#define DS_INSTANCETYPE_NC_GOING 0x00000020
179
180#define NTDSDSA_OPT_IS_GC (1 << 0)
181#define NTDSDSA_OPT_DISABLE_INBOUND_REPL (1 << 1)
182#define NTDSDSA_OPT_DISABLE_OUTBOUND_REPL (1 << 2)
183#define NTDSDSA_OPT_DISABLE_NTDSCONN_XLATE (1 << 3)
184
185#define NTDSCONN_OPT_IS_GENERATED (1 << 0)
186#define NTDSCONN_OPT_TWOWAY_SYNC (1 << 1)
187#define NTDSCONN_OPT_OVERRIDE_NOTIFY_DEFAULT (1 << 2)
188#define NTDSCONN_OPT_USE_NOTIFY (1 << 3)
189#define NTDSCONN_OPT_DISABLE_INTERSITE_COMPRESSION (1 << 4)
190#define NTDSCONN_OPT_USER_OWNED_SCHEDULE (1 << 5)
191
192#define NTDSCONN_KCC_NO_REASON (0)
193#define NTDSCONN_KCC_GC_TOPOLOGY (1 << 0)
194#define NTDSCONN_KCC_RING_TOPOLOGY (1 << 1)
195#define NTDSCONN_KCC_MINIMIZE_HOPS_TOPOLOGY (1 << 2)
196#define NTDSCONN_KCC_STALE_SERVERS_TOPOLOGY (1 << 3)
197#define NTDSCONN_KCC_OSCILLATING_CONNECTION_TOPOLOGY (1 << 4)
198#define NTDSCONN_KCC_INTERSITE_GC_TOPOLOGY (1 << 5)
199#define NTDSCONN_KCC_INTERSITE_TOPOLOGY (1 << 6)
200#define NTDSCONN_KCC_SERVER_FAILOVER_TOPOLOGY (1 << 7)
201#define NTDSCONN_KCC_SITE_FAILOVER_TOPOLOGY (1 << 8)
202#define NTDSCONN_KCC_REDUNDANT_SERVER_TOPOLOGY (1 << 9)
203
204#define FRSCONN_PRIORITY_MASK 0x70000000
205#define FRSCONN_MAX_PRIORITY 0x8
206
207#define NTDSCONN_OPT_IGNORE_SCHEDULE_MASK 0x80000000
208#define NTDSCONN_IGNORE_SCHEDULE(_options_) (((_options_) & NTDSCONN_OPT_IGNORE_SCHEDULE_MASK) >> 31)
209#define FRSCONN_GET_PRIORITY(_options_) (((((_options_) & FRSCONN_PRIORITY_MASK) >> 28)!=0) ? (((_options_) & FRSCONN_PRIORITY_MASK) >> 28) : FRSCONN_MAX_PRIORITY)
210
211#define NTDSSETTINGS_OPT_IS_AUTO_TOPOLOGY_DISABLED (1 << 0)
212#define NTDSSETTINGS_OPT_IS_TOPL_CLEANUP_DISABLED (1 << 1)
213#define NTDSSETTINGS_OPT_IS_TOPL_MIN_HOPS_DISABLED (1 << 2)
214#define NTDSSETTINGS_OPT_IS_TOPL_DETECT_STALE_DISABLED (1 << 3)
215#define NTDSSETTINGS_OPT_IS_INTER_SITE_AUTO_TOPOLOGY_DISABLED (1 << 4)
216#define NTDSSETTINGS_OPT_IS_GROUP_CACHING_ENABLED (1 << 5)
217#define NTDSSETTINGS_OPT_FORCE_KCC_WHISTLER_BEHAVIOR (1 << 6)
218#define NTDSSETTINGS_OPT_FORCE_KCC_W2K_ELECTION (1 << 7)
219#define NTDSSETTINGS_OPT_IS_RAND_BH_SELECTION_DISABLED (1 << 8)
220#define NTDSSETTINGS_OPT_IS_SCHEDULE_HASHING_ENABLED (1 << 9)
221#define NTDSSETTINGS_OPT_IS_REDUNDANT_SERVER_TOPOLOGY_ENABLED (1 << 10)
222
223#define NTDSSETTINGS_OPT_W2K3_IGNORE_SCHEDULES (1 << 11)
224#define NTDSSETTINGS_OPT_W2K3_BRIDGES_REQUIRED (1 << 12)
225#define NTDSSETTINGS_DEFAULT_SERVER_REDUNDANCY 2
226
227#define NTDSTRANSPORT_OPT_IGNORE_SCHEDULES (1 << 0)
228#define NTDSTRANSPORT_OPT_BRIDGES_REQUIRED (1 << 1)
229
230#define NTDSSITECONN_OPT_USE_NOTIFY (1 << 0)
231#define NTDSSITECONN_OPT_TWOWAY_SYNC (1 << 1)
232#define NTDSSITECONN_OPT_DISABLE_COMPRESSION (1 << 2)
233
234#define NTDSSITELINK_OPT_USE_NOTIFY (1 << 0)
235#define NTDSSITELINK_OPT_TWOWAY_SYNC (1 << 1)
236#define NTDSSITELINK_OPT_DISABLE_COMPRESSION (1 << 2)
237
238#define GUID_USERS_CONTAINER_A "a9d1ca15768811d1aded00c04fd8d5cd"
239#define GUID_COMPUTRS_CONTAINER_A "aa312825768811d1aded00c04fd8d5cd"
240#define GUID_SYSTEMS_CONTAINER_A "ab1d30f3768811d1aded00c04fd8d5cd"
241#define GUID_DOMAIN_CONTROLLERS_CONTAINER_A "a361b2ffffd211d1aa4b00c04fd7d83a"
242#define GUID_INFRASTRUCTURE_CONTAINER_A "2fbac1870ade11d297c400c04fd8d5cd"
243#define GUID_DELETED_OBJECTS_CONTAINER_A "18e2ea80684f11d2b9aa00c04f79f805"
244#define GUID_LOSTANDFOUND_CONTAINER_A "ab8153b7768811d1aded00c04fd8d5cd"
245#define GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_A "22b70c67d56e4efb91e9300fca3dc1aa"
246#define GUID_PROGRAM_DATA_CONTAINER_A "09460c08ae1e4a4ea0f64aee7daa1e5a"
247#define GUID_MICROSOFT_PROGRAM_DATA_CONTAINER_A "f4be92a4c777485e878e9421d53087db"
248#define GUID_NTDS_QUOTAS_CONTAINER_A "6227f0af1fc2410d8e3bb10615bb5b0f"
249
250#define GUID_USERS_CONTAINER_W L"a9d1ca15768811d1aded00c04fd8d5cd"
251#define GUID_COMPUTRS_CONTAINER_W L"aa312825768811d1aded00c04fd8d5cd"
252#define GUID_SYSTEMS_CONTAINER_W L"ab1d30f3768811d1aded00c04fd8d5cd"
253#define GUID_DOMAIN_CONTROLLERS_CONTAINER_W L"a361b2ffffd211d1aa4b00c04fd7d83a"
254#define GUID_INFRASTRUCTURE_CONTAINER_W L"2fbac1870ade11d297c400c04fd8d5cd"
255#define GUID_DELETED_OBJECTS_CONTAINER_W L"18e2ea80684f11d2b9aa00c04f79f805"
256#define GUID_LOSTANDFOUND_CONTAINER_W L"ab8153b7768811d1aded00c04fd8d5cd"
257#define GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_W L"22b70c67d56e4efb91e9300fca3dc1aa"
258#define GUID_PROGRAM_DATA_CONTAINER_W L"09460c08ae1e4a4ea0f64aee7daa1e5a"
259#define GUID_MICROSOFT_PROGRAM_DATA_CONTAINER_W L"f4be92a4c777485e878e9421d53087db"
260#define GUID_NTDS_QUOTAS_CONTAINER_W L"6227f0af1fc2410d8e3bb10615bb5b0f"
261
262#define GUID_USERS_CONTAINER_BYTE "\xa9\xd1\xca\x15\x76\x88\x11\xd1\xad\xed\x00\xc0\x4f\xd8\xd5\xcd"
263#define GUID_COMPUTRS_CONTAINER_BYTE "\xaa\x31\x28\x25\x76\x88\x11\xd1\xad\xed\x00\xc0\x4f\xd8\xd5\xcd"
264#define GUID_SYSTEMS_CONTAINER_BYTE "\xab\x1d\x30\xf3\x76\x88\x11\xd1\xad\xed\x00\xc0\x4f\xd8\xd5\xcd"
265#define GUID_DOMAIN_CONTROLLERS_CONTAINER_BYTE "\xa3\x61\xb2\xff\xff\xd2\x11\xd1\xaa\x4b\x00\xc0\x4f\xd7\xd8\x3a"
266#define GUID_INFRASTRUCTURE_CONTAINER_BYTE "\x2f\xba\xc1\x87\x0a\xde\x11\xd2\x97\xc4\x00\xc0\x4f\xd8\xd5\xcd"
267#define GUID_DELETED_OBJECTS_CONTAINER_BYTE "\x18\xe2\xea\x80\x68\x4f\x11\xd2\xb9\xaa\x00\xc0\x4f\x79\xf8\x05"
268#define GUID_LOSTANDFOUND_CONTAINER_BYTE "\xab\x81\x53\xb7\x76\x88\x11\xd1\xad\xed\x00\xc0\x4f\xd8\xd5\xcd"
269#define GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_BYTE "\x22\xb7\x0c\x67\xd5\x6e\x4e\xfb\x91\xe9\x30\x0f\xca\x3d\xc1\xaa"
270#define GUID_PROGRAM_DATA_CONTAINER_BYTE "\x09\x46\x0c\x08\xae\x1e\x4a\x4e\xa0\xf6\x4a\xee\x7d\xaa\x1e\x5a"
271#define GUID_MICROSOFT_PROGRAM_DATA_CONTAINER_BYTE "\xf4\xbe\x92\xa4\xc7\x77\x48\x5e\x87\x8e\x94\x21\xd5\x30\x87\xdb"
272#define GUID_NTDS_QUOTAS_CONTAINER_BYTE "\x62\x27\xf0\xaf\x1f\xc2\x41\x0d\x8e\x3b\xb1\x06\x15\xbb\x5b\x0f"
273
274 typedef enum _DS_MANGLE_FOR {
275 DS_MANGLE_UNKNOWN = 0,DS_MANGLE_OBJECT_RDN_FOR_DELETION,DS_MANGLE_OBJECT_RDN_FOR_NAME_CONFLICT
276 } DS_MANGLE_FOR;
277
278#define DsBind __MINGW_NAME_AW(DsBind)
279#define DsBindWithCred __MINGW_NAME_AW(DsBindWithCred)
280#define DsBindWithSpn __MINGW_NAME_AW(DsBindWithSpn)
281#define DsBindWithSpnEx __MINGW_NAME_AW(DsBindWithSpnEx)
282#define DsBindToISTG __MINGW_NAME_AW(DsBindToISTG)
283#define DsUnBind __MINGW_NAME_AW(DsUnBind)
284#define DsMakePasswordCredentials __MINGW_NAME_AW(DsMakePasswordCredentials)
285#define DsCrackNames __MINGW_NAME_AW(DsCrackNames)
286#define DsFreeNameResult __MINGW_NAME_AW(DsFreeNameResult)
287#define DsMakeSpn __MINGW_NAME_AW(DsMakeSpn)
288#define DsGetSpn __MINGW_NAME_AW(DsGetSpn)
289#define DsFreeSpnArray __MINGW_NAME_AW(DsFreeSpnArray)
290#define DsCrackSpn __MINGW_NAME_AW(DsCrackSpn)
291#define DsWriteAccountSpn __MINGW_NAME_AW(DsWriteAccountSpn)
292#define DsClientMakeSpnForTargetServer __MINGW_NAME_AW(DsClientMakeSpnForTargetServer)
293#define DsServerRegisterSpn __MINGW_NAME_AW(DsServerRegisterSpn)
294#define DsReplicaSync __MINGW_NAME_AW(DsReplicaSync)
295#define DsReplicaAdd __MINGW_NAME_AW(DsReplicaAdd)
296#define DsReplicaDel __MINGW_NAME_AW(DsReplicaDel)
297#define DsReplicaModify __MINGW_NAME_AW(DsReplicaModify)
298#define DsReplicaUpdateRefs __MINGW_NAME_AW(DsReplicaUpdateRefs)
299
300#define DsFreePasswordCredentialsW DsFreePasswordCredentials
301#define DsFreePasswordCredentialsA DsFreePasswordCredentials
302
303 NTDSAPI DWORD WINAPI DsBindW(LPCWSTR DomainControllerName,LPCWSTR DnsDomainName,HANDLE *phDS);
304 NTDSAPI DWORD WINAPI DsBindA(LPCSTR DomainControllerName,LPCSTR DnsDomainName,HANDLE *phDS);
305 NTDSAPI DWORD WINAPI DsBindWithCredW(LPCWSTR DomainControllerName,LPCWSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,HANDLE *phDS);
306 NTDSAPI DWORD WINAPI DsBindWithCredA(LPCSTR DomainControllerName,LPCSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,HANDLE *phDS);
307 NTDSAPI DWORD WINAPI DsBindWithSpnW(LPCWSTR DomainControllerName,LPCWSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,LPCWSTR ServicePrincipalName,HANDLE *phDS);
308 NTDSAPI DWORD WINAPI DsBindWithSpnA(LPCSTR DomainControllerName,LPCSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,LPCSTR ServicePrincipalName,HANDLE *phDS);
309 NTDSAPI_POSTXP DWORD WINAPI DsBindWithSpnExW(LPCWSTR DomainControllerName,LPCWSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,LPCWSTR ServicePrincipalName,DWORD BindFlags,HANDLE *phDS);
310 NTDSAPI_POSTXP DWORD WINAPI DsBindWithSpnExA(LPCSTR DomainControllerName,LPCSTR DnsDomainName,RPC_AUTH_IDENTITY_HANDLE AuthIdentity,LPCSTR ServicePrincipalName,DWORD BindFlags,HANDLE *phDS);
311 NTDSAPI_POSTXP DWORD WINAPI DsBindToISTGW(LPCWSTR SiteName,HANDLE *phDS);
312 NTDSAPI_POSTXP DWORD WINAPI DsBindToISTGA(LPCSTR SiteName,HANDLE *phDS);
313 NTDSAPI_POSTXP DWORD WINAPI DsBindingSetTimeout(HANDLE hDS,ULONG cTimeoutSecs);
314 NTDSAPI DWORD WINAPI DsUnBindW(HANDLE *phDS);
315 NTDSAPI DWORD WINAPI DsUnBindA(HANDLE *phDS);
316 NTDSAPI DWORD WINAPI DsMakePasswordCredentialsW(LPCWSTR User,LPCWSTR Domain,LPCWSTR Password,RPC_AUTH_IDENTITY_HANDLE *pAuthIdentity);
317 NTDSAPI DWORD WINAPI DsMakePasswordCredentialsA(LPCSTR User,LPCSTR Domain,LPCSTR Password,RPC_AUTH_IDENTITY_HANDLE *pAuthIdentity);
318 NTDSAPI VOID WINAPI DsFreePasswordCredentials(RPC_AUTH_IDENTITY_HANDLE AuthIdentity);
319 NTDSAPI DWORD WINAPI DsCrackNamesW(HANDLE hDS,DS_NAME_FLAGS flags,DS_NAME_FORMAT formatOffered,DS_NAME_FORMAT formatDesired,DWORD cNames,const LPCWSTR *rpNames,PDS_NAME_RESULTW *ppResult);
320 NTDSAPI DWORD WINAPI DsCrackNamesA(HANDLE hDS,DS_NAME_FLAGS flags,DS_NAME_FORMAT formatOffered,DS_NAME_FORMAT formatDesired,DWORD cNames,const LPCSTR *rpNames,PDS_NAME_RESULTA *ppResult);
321 NTDSAPI void WINAPI DsFreeNameResultW(DS_NAME_RESULTW *pResult);
322 NTDSAPI void WINAPI DsFreeNameResultA(DS_NAME_RESULTA *pResult);
323 NTDSAPI DWORD WINAPI DsMakeSpnW(LPCWSTR ServiceClass,LPCWSTR ServiceName,LPCWSTR InstanceName,USHORT InstancePort,LPCWSTR Referrer,DWORD *pcSpnLength,LPWSTR pszSpn);
324 NTDSAPI DWORD WINAPI DsMakeSpnA(LPCSTR ServiceClass,LPCSTR ServiceName,LPCSTR InstanceName,USHORT InstancePort,LPCSTR Referrer,DWORD *pcSpnLength,LPSTR pszSpn);
325 NTDSAPI DWORD WINAPI DsGetSpnA(DS_SPN_NAME_TYPE ServiceType,LPCSTR ServiceClass,LPCSTR ServiceName,USHORT InstancePort,USHORT cInstanceNames,LPCSTR *pInstanceNames,const USHORT *pInstancePorts,DWORD *pcSpn,LPSTR **prpszSpn);
326 NTDSAPI DWORD WINAPI DsGetSpnW(DS_SPN_NAME_TYPE ServiceType,LPCWSTR ServiceClass,LPCWSTR ServiceName,USHORT InstancePort,USHORT cInstanceNames,LPCWSTR *pInstanceNames,const USHORT *pInstancePorts,DWORD *pcSpn,LPWSTR **prpszSpn);
327 NTDSAPI void WINAPI DsFreeSpnArrayA(DWORD cSpn,LPSTR *rpszSpn);
328 NTDSAPI void WINAPI DsFreeSpnArrayW(DWORD cSpn,LPWSTR *rpszSpn);
329 NTDSAPI DWORD WINAPI DsCrackSpnA(LPCSTR pszSpn,LPDWORD pcServiceClass,LPSTR ServiceClass,LPDWORD pcServiceName,LPSTR ServiceName,LPDWORD pcInstanceName,LPSTR InstanceName,USHORT *pInstancePort);
330 NTDSAPI DWORD WINAPI DsCrackSpnW(LPCWSTR pszSpn,DWORD *pcServiceClass,LPWSTR ServiceClass,DWORD *pcServiceName,LPWSTR ServiceName,DWORD *pcInstanceName,LPWSTR InstanceName,USHORT *pInstancePort);
331 NTDSAPI DWORD WINAPI DsWriteAccountSpnA(HANDLE hDS,DS_SPN_WRITE_OP Operation,LPCSTR pszAccount,DWORD cSpn,LPCSTR *rpszSpn);
332 NTDSAPI DWORD WINAPI DsWriteAccountSpnW(HANDLE hDS,DS_SPN_WRITE_OP Operation,LPCWSTR pszAccount,DWORD cSpn,LPCWSTR *rpszSpn);
333 NTDSAPI DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR ServiceClass,LPCWSTR ServiceName,DWORD *pcSpnLength,LPWSTR pszSpn);
334 NTDSAPI DWORD WINAPI DsClientMakeSpnForTargetServerA(LPCSTR ServiceClass,LPCSTR ServiceName,DWORD *pcSpnLength,LPSTR pszSpn);
335 NTDSAPI DWORD WINAPI DsServerRegisterSpnA(DS_SPN_WRITE_OP Operation,LPCSTR ServiceClass,LPCSTR UserObjectDN);
336 NTDSAPI DWORD WINAPI DsServerRegisterSpnW(DS_SPN_WRITE_OP Operation,LPCWSTR ServiceClass,LPCWSTR UserObjectDN);
337 NTDSAPI DWORD WINAPI DsReplicaSyncA(HANDLE hDS,LPCSTR NameContext,const UUID *pUuidDsaSrc,ULONG Options);
338 NTDSAPI DWORD WINAPI DsReplicaSyncW(HANDLE hDS,LPCWSTR NameContext,const UUID *pUuidDsaSrc,ULONG Options);
339 NTDSAPI DWORD WINAPI DsReplicaAddA(HANDLE hDS,LPCSTR NameContext,LPCSTR SourceDsaDn,LPCSTR TransportDn,LPCSTR SourceDsaAddress,const PSCHEDULE pSchedule,DWORD Options);
340 NTDSAPI DWORD WINAPI DsReplicaAddW(HANDLE hDS,LPCWSTR NameContext,LPCWSTR SourceDsaDn,LPCWSTR TransportDn,LPCWSTR SourceDsaAddress,const PSCHEDULE pSchedule,DWORD Options);
341 NTDSAPI DWORD WINAPI DsReplicaDelA(HANDLE hDS,LPCSTR NameContext,LPCSTR DsaSrc,ULONG Options);
342 NTDSAPI DWORD WINAPI DsReplicaDelW(HANDLE hDS,LPCWSTR NameContext,LPCWSTR DsaSrc,ULONG Options);
343 NTDSAPI DWORD WINAPI DsReplicaModifyA(HANDLE hDS,LPCSTR NameContext,const UUID *pUuidSourceDsa,LPCSTR TransportDn,LPCSTR SourceDsaAddress,const PSCHEDULE pSchedule,DWORD ReplicaFlags,DWORD ModifyFields,DWORD Options);
344 NTDSAPI DWORD WINAPI DsReplicaModifyW(HANDLE hDS,LPCWSTR NameContext,const UUID *pUuidSourceDsa,LPCWSTR TransportDn,LPCWSTR SourceDsaAddress,const PSCHEDULE pSchedule,DWORD ReplicaFlags,DWORD ModifyFields,DWORD Options);
345 NTDSAPI DWORD WINAPI DsReplicaUpdateRefsA(HANDLE hDS,LPCSTR NameContext,LPCSTR DsaDest,const UUID *pUuidDsaDest,ULONG Options);
346 NTDSAPI DWORD WINAPI DsReplicaUpdateRefsW(HANDLE hDS,LPCWSTR NameContext,LPCWSTR DsaDest,const UUID *pUuidDsaDest,ULONG Options);
347
348 typedef enum {
349 DS_REPSYNCALL_WIN32_ERROR_CONTACTING_SERVER = 0,DS_REPSYNCALL_WIN32_ERROR_REPLICATING = 1,DS_REPSYNCALL_SERVER_UNREACHABLE = 2
350 } DS_REPSYNCALL_ERROR;
351
352 typedef enum {
353 DS_REPSYNCALL_EVENT_ERROR = 0,DS_REPSYNCALL_EVENT_SYNC_STARTED = 1,DS_REPSYNCALL_EVENT_SYNC_COMPLETED = 2,DS_REPSYNCALL_EVENT_FINISHED = 3
354 } DS_REPSYNCALL_EVENT;
355
356 typedef struct {
357 LPSTR pszSrcId;
358 LPSTR pszDstId;
359 LPSTR pszNC;
360 GUID *pguidSrc;
361 GUID *pguidDst;
362 } DS_REPSYNCALL_SYNCA,*PDS_REPSYNCALL_SYNCA;
363
364 typedef struct {
365 LPWSTR pszSrcId;
366 LPWSTR pszDstId;
367 LPWSTR pszNC;
368 GUID *pguidSrc;
369 GUID *pguidDst;
370 } DS_REPSYNCALL_SYNCW,*PDS_REPSYNCALL_SYNCW;
371
372 typedef struct {
373 LPSTR pszSvrId;
374 DS_REPSYNCALL_ERROR error;
375 DWORD dwWin32Err;
376 LPSTR pszSrcId;
377 } DS_REPSYNCALL_ERRINFOA,*PDS_REPSYNCALL_ERRINFOA;
378
379 typedef struct {
380 LPWSTR pszSvrId;
381 DS_REPSYNCALL_ERROR error;
382 DWORD dwWin32Err;
383 LPWSTR pszSrcId;
384 } DS_REPSYNCALL_ERRINFOW,*PDS_REPSYNCALL_ERRINFOW;
385
386 typedef struct {
387 DS_REPSYNCALL_EVENT event;
388 DS_REPSYNCALL_ERRINFOA *pErrInfo;
389 DS_REPSYNCALL_SYNCA *pSync;
390 } DS_REPSYNCALL_UPDATEA,*PDS_REPSYNCALL_UPDATEA;
391
392 typedef struct {
393 DS_REPSYNCALL_EVENT event;
394 DS_REPSYNCALL_ERRINFOW *pErrInfo;
395 DS_REPSYNCALL_SYNCW *pSync;
396 } DS_REPSYNCALL_UPDATEW,*PDS_REPSYNCALL_UPDATEW;
397
398#define DS_REPSYNCALL_SYNC __MINGW_NAME_AW(DS_REPSYNCALL_SYNC)
399#define DS_REPSYNCALL_ERRINFO __MINGW_NAME_AW(DS_REPSYNCALL_ERRINFO)
400#define DS_REPSYNCALL_UPDATE __MINGW_NAME_AW(DS_REPSYNCALL_UPDATE)
401#define PDS_REPSYNCALL_SYNC __MINGW_NAME_AW(PDS_REPSYNCALL_SYNC)
402#define PDS_REPSYNCALL_ERRINFO __MINGW_NAME_AW(PDS_REPSYNCALL_ERRINFO)
403#define PDS_REPSYNCALL_UPDATE __MINGW_NAME_AW(PDS_REPSYNCALL_UPDATE)
404
405#define DS_REPSYNCALL_NO_OPTIONS 0x00000000
406#define DS_REPSYNCALL_ABORT_IF_SERVER_UNAVAILABLE 0x00000001
407#define DS_REPSYNCALL_SYNC_ADJACENT_SERVERS_ONLY 0x00000002
408#define DS_REPSYNCALL_ID_SERVERS_BY_DN 0x00000004
409#define DS_REPSYNCALL_DO_NOT_SYNC 0x00000008
410#define DS_REPSYNCALL_SKIP_INITIAL_CHECK 0x00000010
411#define DS_REPSYNCALL_PUSH_CHANGES_OUTWARD 0x00000020
412#define DS_REPSYNCALL_CROSS_SITE_BOUNDARIES 0x00000040
413
414#define DsReplicaSyncAll __MINGW_NAME_AW(DsReplicaSyncAll)
415#define DsRemoveDsServer __MINGW_NAME_AW(DsRemoveDsServer)
416#define DsRemoveDsDomain __MINGW_NAME_AW(DsRemoveDsDomain)
417#define DsListSites __MINGW_NAME_AW(DsListSites)
418#define DsListServersInSite __MINGW_NAME_AW(DsListServersInSite)
419#define DsListDomainsInSite __MINGW_NAME_AW(DsListDomainsInSite)
420#define DsListServersForDomainInSite __MINGW_NAME_AW(DsListServersForDomainInSite)
421#define DsListInfoForServer __MINGW_NAME_AW(DsListInfoForServer)
422#define DsListRoles __MINGW_NAME_AW(DsListRoles)
423
424#define DS_LIST_DSA_OBJECT_FOR_SERVER 0
425#define DS_LIST_DNS_HOST_NAME_FOR_SERVER 1
426#define DS_LIST_ACCOUNT_OBJECT_FOR_SERVER 2
427
428#define DS_ROLE_SCHEMA_OWNER 0
429#define DS_ROLE_DOMAIN_OWNER 1
430#define DS_ROLE_PDC_OWNER 2
431#define DS_ROLE_RID_OWNER 3
432#define DS_ROLE_INFRASTRUCTURE_OWNER 4
433
434 NTDSAPI DWORD WINAPI DsReplicaSyncAllA (HANDLE hDS,LPCSTR pszNameContext,ULONG ulFlags,WINBOOL (WINAPI *pFnCallBack) (LPVOID,PDS_REPSYNCALL_UPDATEA),LPVOID pCallbackData,PDS_REPSYNCALL_ERRINFOA **pErrors);
435 NTDSAPI DWORD WINAPI DsReplicaSyncAllW (HANDLE hDS,LPCWSTR pszNameContext,ULONG ulFlags,WINBOOL (WINAPI *pFnCallBack) (LPVOID,PDS_REPSYNCALL_UPDATEW),LPVOID pCallbackData,PDS_REPSYNCALL_ERRINFOW **pErrors);
436 NTDSAPI DWORD WINAPI DsRemoveDsServerW(HANDLE hDs,LPWSTR ServerDN,LPWSTR DomainDN,WINBOOL *fLastDcInDomain,WINBOOL fCommit);
437 NTDSAPI DWORD WINAPI DsRemoveDsServerA(HANDLE hDs,LPSTR ServerDN,LPSTR DomainDN,WINBOOL *fLastDcInDomain,WINBOOL fCommit);
438 NTDSAPI DWORD WINAPI DsRemoveDsDomainW(HANDLE hDs,LPWSTR DomainDN);
439 NTDSAPI DWORD WINAPI DsRemoveDsDomainA(HANDLE hDs,LPSTR DomainDN);
440 NTDSAPI DWORD WINAPI DsListSitesA(HANDLE hDs,PDS_NAME_RESULTA *ppSites);
441 NTDSAPI DWORD WINAPI DsListSitesW(HANDLE hDs,PDS_NAME_RESULTW *ppSites);
442 NTDSAPI DWORD WINAPI DsListServersInSiteA(HANDLE hDs,LPCSTR site,PDS_NAME_RESULTA *ppServers);
443 NTDSAPI DWORD WINAPI DsListServersInSiteW(HANDLE hDs,LPCWSTR site,PDS_NAME_RESULTW *ppServers);
444 NTDSAPI DWORD WINAPI DsListDomainsInSiteA(HANDLE hDs,LPCSTR site,PDS_NAME_RESULTA *ppDomains);
445 NTDSAPI DWORD WINAPI DsListDomainsInSiteW(HANDLE hDs,LPCWSTR site,PDS_NAME_RESULTW *ppDomains);
446 NTDSAPI DWORD WINAPI DsListServersForDomainInSiteA(HANDLE hDs,LPCSTR domain,LPCSTR site,PDS_NAME_RESULTA *ppServers);
447 NTDSAPI DWORD WINAPI DsListServersForDomainInSiteW(HANDLE hDs,LPCWSTR domain,LPCWSTR site,PDS_NAME_RESULTW *ppServers);
448 NTDSAPI DWORD WINAPI DsListInfoForServerA(HANDLE hDs,LPCSTR server,PDS_NAME_RESULTA *ppInfo);
449 NTDSAPI DWORD WINAPI DsListInfoForServerW(HANDLE hDs,LPCWSTR server,PDS_NAME_RESULTW *ppInfo);
450 NTDSAPI DWORD WINAPI DsListRolesA(HANDLE hDs,PDS_NAME_RESULTA *ppRoles);
451 NTDSAPI DWORD WINAPI DsListRolesW(HANDLE hDs,PDS_NAME_RESULTW *ppRoles);
452
453 typedef struct {
454 DWORD errorCode;
455 DWORD cost;
456 } DS_SITE_COST_INFO,*PDS_SITE_COST_INFO;
457
458#define DsQuerySitesByCost __MINGW_NAME_AW(DsQuerySitesByCost)
459
460 NTDSAPI_POSTXP DWORD WINAPI DsQuerySitesByCostW(HANDLE hDS,LPWSTR pwszFromSite,LPWSTR *rgwszToSites,DWORD cToSites,DWORD dwFlags,PDS_SITE_COST_INFO *prgSiteInfo);
461 NTDSAPI_POSTXP DWORD WINAPI DsQuerySitesByCostA(HANDLE hDS,LPSTR pwszFromSite,LPSTR *rgwszToSites,DWORD cToSites,DWORD dwFlags,PDS_SITE_COST_INFO *prgSiteInfo);
462 VOID DsQuerySitesFree(PDS_SITE_COST_INFO rgSiteInfo);
463
464#define DS_SCHEMA_GUID_NOT_FOUND 0
465#define DS_SCHEMA_GUID_ATTR 1
466#define DS_SCHEMA_GUID_ATTR_SET 2
467#define DS_SCHEMA_GUID_CLASS 3
468#define DS_SCHEMA_GUID_CONTROL_RIGHT 4
469
470 typedef struct {
471 GUID guid;
472 DWORD guidType;
473 LPSTR pName;
474 } DS_SCHEMA_GUID_MAPA,*PDS_SCHEMA_GUID_MAPA;
475
476 typedef struct {
477 GUID guid;
478 DWORD guidType;
479 LPWSTR pName;
480 } DS_SCHEMA_GUID_MAPW,*PDS_SCHEMA_GUID_MAPW;
481
482 NTDSAPI DWORD WINAPI DsMapSchemaGuidsA(HANDLE hDs,DWORD cGuids,GUID *rGuids,DS_SCHEMA_GUID_MAPA **ppGuidMap);
483 NTDSAPI VOID WINAPI DsFreeSchemaGuidMapA(PDS_SCHEMA_GUID_MAPA pGuidMap);
484 NTDSAPI DWORD WINAPI DsMapSchemaGuidsW(HANDLE hDs,DWORD cGuids,GUID *rGuids,DS_SCHEMA_GUID_MAPW **ppGuidMap);
485 NTDSAPI VOID WINAPI DsFreeSchemaGuidMapW(PDS_SCHEMA_GUID_MAPW pGuidMap);
486
487#define DS_SCHEMA_GUID_MAP __MINGW_NAME_AW(DS_SCHEMA_GUID_MAP)
488#define PDS_SCHEMA_GUID_MAP __MINGW_NAME_AW(PDS_SCHEMA_GUID_MAP)
489#define DsMapSchemaGuids __MINGW_NAME_AW(DsMapSchemaGuids)
490#define DsFreeSchemaGuidMap __MINGW_NAME_AW(DsFreeSchemaGuidMap)
491
492 typedef struct {
493 LPSTR NetbiosName;
494 LPSTR DnsHostName;
495 LPSTR SiteName;
496 LPSTR ComputerObjectName;
497 LPSTR ServerObjectName;
498 WINBOOL fIsPdc;
499 WINBOOL fDsEnabled;
500 } DS_DOMAIN_CONTROLLER_INFO_1A,*PDS_DOMAIN_CONTROLLER_INFO_1A;
501
502 typedef struct {
503 LPWSTR NetbiosName;
504 LPWSTR DnsHostName;
505 LPWSTR SiteName;
506 LPWSTR ComputerObjectName;
507 LPWSTR ServerObjectName;
508 WINBOOL fIsPdc;
509 WINBOOL fDsEnabled;
510 } DS_DOMAIN_CONTROLLER_INFO_1W,*PDS_DOMAIN_CONTROLLER_INFO_1W;
511
512 typedef struct {
513 LPSTR NetbiosName;
514 LPSTR DnsHostName;
515 LPSTR SiteName;
516 LPSTR SiteObjectName;
517 LPSTR ComputerObjectName;
518 LPSTR ServerObjectName;
519 LPSTR NtdsDsaObjectName;
520 WINBOOL fIsPdc;
521 WINBOOL fDsEnabled;
522 WINBOOL fIsGc;
523 GUID SiteObjectGuid;
524 GUID ComputerObjectGuid;
525 GUID ServerObjectGuid;
526 GUID NtdsDsaObjectGuid;
527 } DS_DOMAIN_CONTROLLER_INFO_2A,*PDS_DOMAIN_CONTROLLER_INFO_2A;
528
529 typedef struct {
530 LPWSTR NetbiosName;
531 LPWSTR DnsHostName;
532 LPWSTR SiteName;
533 LPWSTR SiteObjectName;
534 LPWSTR ComputerObjectName;
535 LPWSTR ServerObjectName;
536 LPWSTR NtdsDsaObjectName;
537 WINBOOL fIsPdc;
538 WINBOOL fDsEnabled;
539 WINBOOL fIsGc;
540 GUID SiteObjectGuid;
541 GUID ComputerObjectGuid;
542 GUID ServerObjectGuid;
543 GUID NtdsDsaObjectGuid;
544 } DS_DOMAIN_CONTROLLER_INFO_2W,*PDS_DOMAIN_CONTROLLER_INFO_2W;
545
546 NTDSAPI DWORD WINAPI DsGetDomainControllerInfoA(HANDLE hDs,LPCSTR DomainName,DWORD InfoLevel,DWORD *pcOut,VOID **ppInfo);
547 NTDSAPI DWORD WINAPI DsGetDomainControllerInfoW(HANDLE hDs,LPCWSTR DomainName,DWORD InfoLevel,DWORD *pcOut,VOID **ppInfo);
548 NTDSAPI VOID WINAPI DsFreeDomainControllerInfoA(DWORD InfoLevel,DWORD cInfo,VOID *pInfo);
549 NTDSAPI VOID WINAPI DsFreeDomainControllerInfoW(DWORD InfoLevel,DWORD cInfo,VOID *pInfo);
550
551#define DS_DOMAIN_CONTROLLER_INFO_1 __MINGW_NAME_AW(DS_DOMAIN_CONTROLLER_INFO_1)
552#define DS_DOMAIN_CONTROLLER_INFO_2 __MINGW_NAME_AW(DS_DOMAIN_CONTROLLER_INFO_2)
553#define PDS_DOMAIN_CONTROLLER_INFO_1 __MINGW_NAME_AW(PDS_DOMAIN_CONTROLLER_INFO_1)
554#define PDS_DOMAIN_CONTROLLER_INFO_2 __MINGW_NAME_AW(PDS_DOMAIN_CONTROLLER_INFO_2)
555#define DsGetDomainControllerInfo __MINGW_NAME_AW(DsGetDomainControllerInfo)
556#define DsFreeDomainControllerInfo __MINGW_NAME_AW(DsFreeDomainControllerInfo)
557
558 typedef enum {
559 DS_KCC_TASKID_UPDATE_TOPOLOGY = 0
560 } DS_KCC_TASKID;
561
562#define DS_KCC_FLAG_ASYNC_OP (1 << 0)
563
564#define DS_KCC_FLAG_DAMPED (1 << 1)
565
566#define DsReplicaVerifyObjects __MINGW_NAME_AW(DsReplicaVerifyObjects)
567
568 NTDSAPI DWORD WINAPI DsReplicaConsistencyCheck(HANDLE hDS,DS_KCC_TASKID TaskID,DWORD dwFlags);
569 NTDSAPI DWORD WINAPI DsReplicaVerifyObjectsW(HANDLE hDS,LPCWSTR NameContext,const UUID *pUuidDsaSrc,ULONG ulOptions);
570 NTDSAPI DWORD WINAPI DsReplicaVerifyObjectsA(HANDLE hDS,LPCSTR NameContext,const UUID *pUuidDsaSrc,ULONG ulOptions);
571
572#define DS_EXIST_ADVISORY_MODE (0x1)
573
574 typedef enum _DS_REPL_INFO_TYPE {
575 DS_REPL_INFO_NEIGHBORS = 0,DS_REPL_INFO_CURSORS_FOR_NC = 1,DS_REPL_INFO_METADATA_FOR_OBJ = 2,DS_REPL_INFO_KCC_DSA_CONNECT_FAILURES = 3,
576 DS_REPL_INFO_KCC_DSA_LINK_FAILURES = 4,DS_REPL_INFO_PENDING_OPS = 5,DS_REPL_INFO_METADATA_FOR_ATTR_VALUE = 6,DS_REPL_INFO_CURSORS_2_FOR_NC = 7,
577 DS_REPL_INFO_CURSORS_3_FOR_NC = 8,DS_REPL_INFO_METADATA_2_FOR_OBJ = 9,DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE = 10,DS_REPL_INFO_TYPE_MAX
578 } DS_REPL_INFO_TYPE;
579
580#define DS_REPL_INFO_FLAG_IMPROVE_LINKED_ATTRS (0x00000001)
581
582#define DS_REPL_NBR_WRITEABLE (0x00000010)
583#define DS_REPL_NBR_SYNC_ON_STARTUP (0x00000020)
584#define DS_REPL_NBR_DO_SCHEDULED_SYNCS (0x00000040)
585#define DS_REPL_NBR_USE_ASYNC_INTERSITE_TRANSPORT (0x00000080)
586#define DS_REPL_NBR_TWO_WAY_SYNC (0x00000200)
587#define DS_REPL_NBR_RETURN_OBJECT_PARENTS (0x00000800)
588#define DS_REPL_NBR_FULL_SYNC_IN_PROGRESS (0x00010000)
589#define DS_REPL_NBR_FULL_SYNC_NEXT_PACKET (0x00020000)
590#define DS_REPL_NBR_NEVER_SYNCED (0x00200000)
591#define DS_REPL_NBR_PREEMPTED (0x01000000)
592#define DS_REPL_NBR_IGNORE_CHANGE_NOTIFICATIONS (0x04000000)
593#define DS_REPL_NBR_DISABLE_SCHEDULED_SYNC (0x08000000)
594#define DS_REPL_NBR_COMPRESS_CHANGES (0x10000000)
595#define DS_REPL_NBR_NO_CHANGE_NOTIFICATIONS (0x20000000)
596#define DS_REPL_NBR_PARTIAL_ATTRIBUTE_SET (0x40000000)
597
598#define DS_REPL_NBR_MODIFIABLE_MASK (DS_REPL_NBR_SYNC_ON_STARTUP | DS_REPL_NBR_DO_SCHEDULED_SYNCS | DS_REPL_NBR_TWO_WAY_SYNC | DS_REPL_NBR_IGNORE_CHANGE_NOTIFICATIONS | DS_REPL_NBR_DISABLE_SCHEDULED_SYNC | DS_REPL_NBR_COMPRESS_CHANGES | DS_REPL_NBR_NO_CHANGE_NOTIFICATIONS)
599
600 typedef struct _DS_REPL_NEIGHBORW {
601 LPWSTR pszNamingContext;
602 LPWSTR pszSourceDsaDN;
603 LPWSTR pszSourceDsaAddress;
604 LPWSTR pszAsyncIntersiteTransportDN;
605 DWORD dwReplicaFlags;
606 DWORD dwReserved;
607 UUID uuidNamingContextObjGuid;
608 UUID uuidSourceDsaObjGuid;
609 UUID uuidSourceDsaInvocationID;
610 UUID uuidAsyncIntersiteTransportObjGuid;
611 USN usnLastObjChangeSynced;
612 USN usnAttributeFilter;
613 FILETIME ftimeLastSyncSuccess;
614 FILETIME ftimeLastSyncAttempt;
615 DWORD dwLastSyncResult;
616 DWORD cNumConsecutiveSyncFailures;
617 } DS_REPL_NEIGHBORW;
618
619 typedef struct _DS_REPL_NEIGHBORW_BLOB {
620 DWORD oszNamingContext;
621 DWORD oszSourceDsaDN;
622 DWORD oszSourceDsaAddress;
623 DWORD oszAsyncIntersiteTransportDN;
624 DWORD dwReplicaFlags;
625 DWORD dwReserved;
626 UUID uuidNamingContextObjGuid;
627 UUID uuidSourceDsaObjGuid;
628 UUID uuidSourceDsaInvocationID;
629 UUID uuidAsyncIntersiteTransportObjGuid;
630 USN usnLastObjChangeSynced;
631 USN usnAttributeFilter;
632 FILETIME ftimeLastSyncSuccess;
633 FILETIME ftimeLastSyncAttempt;
634 DWORD dwLastSyncResult;
635 DWORD cNumConsecutiveSyncFailures;
636 } DS_REPL_NEIGHBORW_BLOB;
637
638 typedef struct _DS_REPL_NEIGHBORSW {
639 DWORD cNumNeighbors;
640 DWORD dwReserved;
641 DS_REPL_NEIGHBORW rgNeighbor[1];
642 } DS_REPL_NEIGHBORSW;
643
644 typedef struct _DS_REPL_CURSOR {
645 UUID uuidSourceDsaInvocationID;
646 USN usnAttributeFilter;
647 } DS_REPL_CURSOR;
648
649 typedef struct _DS_REPL_CURSOR_2 {
650 UUID uuidSourceDsaInvocationID;
651 USN usnAttributeFilter;
652 FILETIME ftimeLastSyncSuccess;
653 } DS_REPL_CURSOR_2;
654
655 typedef struct _DS_REPL_CURSOR_3W {
656 UUID uuidSourceDsaInvocationID;
657 USN usnAttributeFilter;
658 FILETIME ftimeLastSyncSuccess;
659 LPWSTR pszSourceDsaDN;
660 } DS_REPL_CURSOR_3W;
661
662 typedef struct _DS_REPL_CURSOR_BLOB {
663 UUID uuidSourceDsaInvocationID;
664 USN usnAttributeFilter;
665 FILETIME ftimeLastSyncSuccess;
666 DWORD oszSourceDsaDN;
667 } DS_REPL_CURSOR_BLOB;
668
669 typedef struct _DS_REPL_CURSORS {
670 DWORD cNumCursors;
671 DWORD dwReserved;
672 DS_REPL_CURSOR rgCursor[1];
673 } DS_REPL_CURSORS;
674
675 typedef struct _DS_REPL_CURSORS_2 {
676 DWORD cNumCursors;
677 DWORD dwEnumerationContext;
678 DS_REPL_CURSOR_2 rgCursor[1];
679 } DS_REPL_CURSORS_2;
680
681 typedef struct _DS_REPL_CURSORS_3W {
682 DWORD cNumCursors;
683 DWORD dwEnumerationContext;
684 DS_REPL_CURSOR_3W rgCursor[1];
685 } DS_REPL_CURSORS_3W;
686
687 typedef struct _DS_REPL_ATTR_META_DATA {
688 LPWSTR pszAttributeName;
689 DWORD dwVersion;
690 FILETIME ftimeLastOriginatingChange;
691 UUID uuidLastOriginatingDsaInvocationID;
692 USN usnOriginatingChange;
693 USN usnLocalChange;
694 } DS_REPL_ATTR_META_DATA;
695
696 typedef struct _DS_REPL_ATTR_META_DATA_2 {
697 LPWSTR pszAttributeName;
698 DWORD dwVersion;
699 FILETIME ftimeLastOriginatingChange;
700 UUID uuidLastOriginatingDsaInvocationID;
701 USN usnOriginatingChange;
702 USN usnLocalChange;
703 LPWSTR pszLastOriginatingDsaDN;
704 } DS_REPL_ATTR_META_DATA_2;
705
706 typedef struct _DS_REPL_ATTR_META_DATA_BLOB {
707 DWORD oszAttributeName;
708 DWORD dwVersion;
709 FILETIME ftimeLastOriginatingChange;
710 UUID uuidLastOriginatingDsaInvocationID;
711 USN usnOriginatingChange;
712 USN usnLocalChange;
713 DWORD oszLastOriginatingDsaDN;
714 } DS_REPL_ATTR_META_DATA_BLOB;
715
716 typedef struct _DS_REPL_OBJ_META_DATA {
717 DWORD cNumEntries;
718 DWORD dwReserved;
719 DS_REPL_ATTR_META_DATA rgMetaData[1];
720 } DS_REPL_OBJ_META_DATA;
721
722 typedef struct _DS_REPL_OBJ_META_DATA_2 {
723 DWORD cNumEntries;
724 DWORD dwReserved;
725 DS_REPL_ATTR_META_DATA_2 rgMetaData[1];
726 } DS_REPL_OBJ_META_DATA_2;
727
728 typedef struct _DS_REPL_KCC_DSA_FAILUREW {
729 LPWSTR pszDsaDN;
730 UUID uuidDsaObjGuid;
731 FILETIME ftimeFirstFailure;
732 DWORD cNumFailures;
733 DWORD dwLastResult;
734 } DS_REPL_KCC_DSA_FAILUREW;
735
736 typedef struct _DS_REPL_KCC_DSA_FAILUREW_BLOB {
737 DWORD oszDsaDN;
738 UUID uuidDsaObjGuid;
739 FILETIME ftimeFirstFailure;
740 DWORD cNumFailures;
741 DWORD dwLastResult;
742 } DS_REPL_KCC_DSA_FAILUREW_BLOB;
743
744 typedef struct _DS_REPL_KCC_DSA_FAILURESW {
745 DWORD cNumEntries;
746 DWORD dwReserved;
747 DS_REPL_KCC_DSA_FAILUREW rgDsaFailure[1];
748 } DS_REPL_KCC_DSA_FAILURESW;
749
750 typedef enum _DS_REPL_OP_TYPE {
751 DS_REPL_OP_TYPE_SYNC = 0,DS_REPL_OP_TYPE_ADD,DS_REPL_OP_TYPE_DELETE,DS_REPL_OP_TYPE_MODIFY,DS_REPL_OP_TYPE_UPDATE_REFS
752 } DS_REPL_OP_TYPE;
753
754 typedef struct _DS_REPL_OPW {
755 FILETIME ftimeEnqueued;
756 ULONG ulSerialNumber;
757 ULONG ulPriority;
758 DS_REPL_OP_TYPE OpType;
759 ULONG ulOptions;
760 LPWSTR pszNamingContext;
761 LPWSTR pszDsaDN;
762 LPWSTR pszDsaAddress;
763 UUID uuidNamingContextObjGuid;
764 UUID uuidDsaObjGuid;
765 } DS_REPL_OPW;
766
767 typedef struct _DS_REPL_OPW_BLOB {
768 FILETIME ftimeEnqueued;
769 ULONG ulSerialNumber;
770 ULONG ulPriority;
771 DS_REPL_OP_TYPE OpType;
772 ULONG ulOptions;
773 DWORD oszNamingContext;
774 DWORD oszDsaDN;
775 DWORD oszDsaAddress;
776 UUID uuidNamingContextObjGuid;
777 UUID uuidDsaObjGuid;
778 } DS_REPL_OPW_BLOB;
779
780 typedef struct _DS_REPL_PENDING_OPSW {
781 FILETIME ftimeCurrentOpStarted;
782 DWORD cNumPendingOps;
783 DS_REPL_OPW rgPendingOp[1];
784 } DS_REPL_PENDING_OPSW;
785
786 typedef struct _DS_REPL_VALUE_META_DATA {
787 LPWSTR pszAttributeName;
788 LPWSTR pszObjectDn;
789 DWORD cbData;
790 BYTE *pbData;
791 FILETIME ftimeDeleted;
792 FILETIME ftimeCreated;
793 DWORD dwVersion;
794 FILETIME ftimeLastOriginatingChange;
795 UUID uuidLastOriginatingDsaInvocationID;
796 USN usnOriginatingChange;
797 USN usnLocalChange;
798 } DS_REPL_VALUE_META_DATA;
799
800 typedef struct _DS_REPL_VALUE_META_DATA_2 {
801 LPWSTR pszAttributeName;
802 LPWSTR pszObjectDn;
803 DWORD cbData;
804 BYTE *pbData;
805 FILETIME ftimeDeleted;
806 FILETIME ftimeCreated;
807 DWORD dwVersion;
808 FILETIME ftimeLastOriginatingChange;
809 UUID uuidLastOriginatingDsaInvocationID;
810 USN usnOriginatingChange;
811 USN usnLocalChange;
812 LPWSTR pszLastOriginatingDsaDN;
813 } DS_REPL_VALUE_META_DATA_2;
814
815 typedef struct _DS_REPL_VALUE_META_DATA_BLOB {
816 DWORD oszAttributeName;
817 DWORD oszObjectDn;
818 DWORD cbData;
819 DWORD obData;
820 FILETIME ftimeDeleted;
821 FILETIME ftimeCreated;
822 DWORD dwVersion;
823 FILETIME ftimeLastOriginatingChange;
824 UUID uuidLastOriginatingDsaInvocationID;
825 USN usnOriginatingChange;
826 USN usnLocalChange;
827 DWORD oszLastOriginatingDsaDN;
828 } DS_REPL_VALUE_META_DATA_BLOB;
829
830 typedef struct _DS_REPL_ATTR_VALUE_META_DATA {
831 DWORD cNumEntries;
832 DWORD dwEnumerationContext;
833 DS_REPL_VALUE_META_DATA rgMetaData[1];
834 } DS_REPL_ATTR_VALUE_META_DATA;
835
836 typedef struct _DS_REPL_ATTR_VALUE_META_DATA_2 {
837 DWORD cNumEntries;
838 DWORD dwEnumerationContext;
839 DS_REPL_VALUE_META_DATA_2 rgMetaData[1];
840 } DS_REPL_ATTR_VALUE_META_DATA_2;
841
842 typedef struct _DS_REPL_QUEUE_STATISTICSW {
843 FILETIME ftimeCurrentOpStarted;
844 DWORD cNumPendingOps;
845 FILETIME ftimeOldestSync;
846 FILETIME ftimeOldestAdd;
847 FILETIME ftimeOldestMod;
848 FILETIME ftimeOldestDel;
849 FILETIME ftimeOldestUpdRefs;
850 } DS_REPL_QUEUE_STATISTICSW;
851
852 typedef struct _DS_REPL_QUEUE_STATISTICSW DS_REPL_QUEUE_STATISTICSW_BLOB;
853
854 NTDSAPI DWORD WINAPI DsReplicaGetInfoW(HANDLE hDS,DS_REPL_INFO_TYPE InfoType,LPCWSTR pszObject,UUID *puuidForSourceDsaObjGuid,VOID **ppInfo);
855 NTDSAPI DWORD WINAPI DsReplicaGetInfo2W(HANDLE hDS,DS_REPL_INFO_TYPE InfoType,LPCWSTR pszObject,UUID *puuidForSourceDsaObjGuid,LPCWSTR pszAttributeName,LPCWSTR pszValue,DWORD dwFlags,DWORD dwEnumerationContext,VOID **ppInfo);
856 NTDSAPI void WINAPI DsReplicaFreeInfo(DS_REPL_INFO_TYPE InfoType,VOID *pInfo);
857
858#if defined(UNICODE)
859#define DsReplicaGetInfo DsReplicaGetInfoW
860#define DsReplicaGetInfo2 DsReplicaGetInfo2W
861#define DS_REPL_NEIGHBOR DS_REPL_NEIGHBORW
862#define DS_REPL_NEIGHBORS DS_REPL_NEIGHBORSW
863#define DS_REPL_CURSOR_3 DS_REPL_CURSOR_3W
864#define DS_REPL_CURSORS_3 DS_REPL_CURSORS_3W
865#define DS_REPL_KCC_DSA_FAILURES DS_REPL_KCC_DSA_FAILURESW
866#define DS_REPL_KCC_DSA_FAILURE DS_REPL_KCC_DSA_FAILUREW
867#define DS_REPL_OP DS_REPL_OPW
868#define DS_REPL_PENDING_OPS DS_REPL_PENDING_OPSW
869#endif
870
871#define DsAddSidHistory __MINGW_NAME_AW(DsAddSidHistory)
872#define DsInheritSecurityIdentity __MINGW_NAME_AW(DsInheritSecurityIdentity)
873
874 NTDSAPI DWORD WINAPI DsAddSidHistoryW(HANDLE hDS,DWORD Flags,LPCWSTR SrcDomain,LPCWSTR SrcPrincipal,LPCWSTR SrcDomainController,RPC_AUTH_IDENTITY_HANDLE SrcDomainCreds,LPCWSTR DstDomain,LPCWSTR DstPrincipal);
875 NTDSAPI DWORD WINAPI DsAddSidHistoryA(HANDLE hDS,DWORD Flags,LPCSTR SrcDomain,LPCSTR SrcPrincipal,LPCSTR SrcDomainController,RPC_AUTH_IDENTITY_HANDLE SrcDomainCreds,LPCSTR DstDomain,LPCSTR DstPrincipal);
876 NTDSAPI DWORD WINAPI DsInheritSecurityIdentityW(HANDLE hDS,DWORD Flags,LPCWSTR SrcPrincipal,LPCWSTR DstPrincipal);
877 NTDSAPI DWORD WINAPI DsInheritSecurityIdentityA(HANDLE hDS,DWORD Flags,LPCSTR SrcPrincipal,LPCSTR DstPrincipal);
878
879#define DsQuoteRdnValue __MINGW_NAME_AW(DsQuoteRdnValue)
880#define DsUnquoteRdnValue __MINGW_NAME_AW(DsUnquoteRdnValue)
881#define DsCrackUnquotedMangledRdn __MINGW_NAME_AW(DsCrackUnquotedMangledRdn)
882#define DsIsMangledRdnValue __MINGW_NAME_AW(DsIsMangledRdnValue)
883#define DsIsMangledDn __MINGW_NAME_AW(DsIsMangledDn)
884
885 NTDSAPI DWORD WINAPI DsQuoteRdnValueW(DWORD cUnquotedRdnValueLength,LPCWCH psUnquotedRdnValue,DWORD *pcQuotedRdnValueLength,LPWCH psQuotedRdnValue);
886 NTDSAPI DWORD WINAPI DsQuoteRdnValueA(DWORD cUnquotedRdnValueLength,LPCCH psUnquotedRdnValue,DWORD *pcQuotedRdnValueLength,LPCH psQuotedRdnValue);
887 NTDSAPI DWORD WINAPI DsUnquoteRdnValueW(DWORD cQuotedRdnValueLength,LPCWCH psQuotedRdnValue,DWORD *pcUnquotedRdnValueLength,LPWCH psUnquotedRdnValue);
888 NTDSAPI DWORD WINAPI DsUnquoteRdnValueA(DWORD cQuotedRdnValueLength,LPCCH psQuotedRdnValue,DWORD *pcUnquotedRdnValueLength,LPCH psUnquotedRdnValue);
889 NTDSAPI DWORD WINAPI DsGetRdnW(LPCWCH *ppDN,DWORD *pcDN,LPCWCH *ppKey,DWORD *pcKey,LPCWCH *ppVal,DWORD *pcVal);
890 NTDSAPI WINBOOL WINAPI DsCrackUnquotedMangledRdnW(LPCWSTR pszRDN,DWORD cchRDN,GUID *pGuid,DS_MANGLE_FOR *peDsMangleFor);
891 NTDSAPI WINBOOL WINAPI DsCrackUnquotedMangledRdnA(LPCSTR pszRDN,DWORD cchRDN,GUID *pGuid,DS_MANGLE_FOR *peDsMangleFor);
892 NTDSAPI WINBOOL WINAPI DsIsMangledRdnValueW(LPCWSTR pszRdn,DWORD cRdn,DS_MANGLE_FOR eDsMangleForDesired);
893 NTDSAPI WINBOOL WINAPI DsIsMangledRdnValueA(LPCSTR pszRdn,DWORD cRdn,DS_MANGLE_FOR eDsMangleForDesired);
894 NTDSAPI WINBOOL WINAPI DsIsMangledDnA(LPCSTR pszDn,DS_MANGLE_FOR eDsMangleFor);
895 NTDSAPI WINBOOL WINAPI DsIsMangledDnW(LPCWSTR pszDn,DS_MANGLE_FOR eDsMangleFor);
896
897#if (_WIN32_WINNT >= 0x0600)
898#define NTDSAPI_BIND_FIND_BINDING (0x00000002)
899#define NTDSAPI_BIND_FORCE_KERBEROS (0x00000004)
900
901#endif /*(_WIN32_WINNT >= 0x0600)*/
902
903#ifdef __cplusplus
904}
905#endif
906#endif
Note: See TracBrowser for help on using the repository browser.