[1046] | 1 | /*
|
---|
| 2 | * dsgetdc.h - Active Directory
|
---|
| 3 | *
|
---|
| 4 | * THIS SOFTWARE IS NOT COPYRIGHTED
|
---|
| 5 | *
|
---|
| 6 | * This source code is offered for use in the public domain. You may use,
|
---|
| 7 | * modify or distribute it freely.
|
---|
| 8 | *
|
---|
| 9 | * This code is distributed in the hope that it will be useful but
|
---|
| 10 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
---|
| 11 | * DISCLAIMED. This includes but is not limited to warranties of
|
---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 13 | *
|
---|
| 14 | */
|
---|
| 15 | #ifndef _DSGETDC_H
|
---|
| 16 | #define _DSGETDC_H
|
---|
| 17 | #if __GNUC__ >= 3
|
---|
| 18 | #pragma GCC system_header
|
---|
| 19 | #endif
|
---|
| 20 |
|
---|
| 21 | #ifdef __cplusplus
|
---|
| 22 | extern "C" {
|
---|
| 23 | #endif
|
---|
| 24 |
|
---|
| 25 | /*--- Active Directory Reference - Active Directory Structures - Directory Service Structures */
|
---|
| 26 | #if (_WIN32_WINNT >= 0x0500)
|
---|
| 27 | #define DS_FORCE_REDISCOVERY 0x00000001
|
---|
| 28 | #define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010
|
---|
| 29 | #define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020
|
---|
| 30 | #define DS_GC_SERVER_REQUIRED 0x00000040
|
---|
| 31 | #define DS_PDC_REQUIRED 0x00000080
|
---|
| 32 | #define DS_BACKGROUND_ONLY 0x00000100
|
---|
| 33 | #define DS_IP_REQUIRED 0x00000200
|
---|
| 34 | #define DS_KDC_REQUIRED 0x00000400
|
---|
| 35 | #define DS_TIMESERV_REQUIRED 0x00000800
|
---|
| 36 | #define DS_WRITABLE_REQUIRED 0x00001000
|
---|
| 37 | #define DS_GOOD_TIMESERV_PREFERRED 0x00002000
|
---|
| 38 | #define DS_AVOID_SELF 0x00004000
|
---|
| 39 | #define DS_ONLY_LDAP_NEEDED 0x00008000
|
---|
| 40 | #define DS_IS_FLAT_NAME 0x00010000
|
---|
| 41 | #define DS_IS_DNS_NAME 0x00020000
|
---|
| 42 | #define DS_RETURN_DNS_NAME 0x40000000
|
---|
| 43 | #define DS_RETURN_FLAT_NAME 0x80000000
|
---|
| 44 | typedef struct _DOMAIN_CONTROLLER_INFOA {
|
---|
| 45 | LPSTR DomainControllerName;
|
---|
| 46 | LPSTR DomainControllerAddress;
|
---|
| 47 | ULONG DomainControllerAddressType;
|
---|
| 48 | GUID DomainGuid;
|
---|
| 49 | LPSTR DomainName;
|
---|
| 50 | LPSTR DnsForestName;
|
---|
| 51 | ULONG Flags;
|
---|
| 52 | LPSTR DcSiteName;
|
---|
| 53 | LPSTR ClientSiteName;
|
---|
| 54 | } DOMAIN_CONTROLLER_INFOA,*PDOMAIN_CONTROLLER_INFOA;
|
---|
| 55 | typedef struct _DOMAIN_CONTROLLER_INFOW {
|
---|
| 56 | LPWSTR DomainControllerName;
|
---|
| 57 | LPWSTR DomainControllerAddress;
|
---|
| 58 | ULONG DomainControllerAddressType;
|
---|
| 59 | GUID DomainGuid;
|
---|
| 60 | LPWSTR DomainName;
|
---|
| 61 | LPWSTR DnsForestName;
|
---|
| 62 | ULONG Flags;
|
---|
| 63 | LPWSTR DcSiteName;
|
---|
| 64 | LPWSTR ClientSiteName;
|
---|
| 65 | } DOMAIN_CONTROLLER_INFOW,*PDOMAIN_CONTROLLER_INFOW;
|
---|
| 66 | #define DS_INET_ADDRESS 0x0001
|
---|
| 67 | #define DS_NETBIOS_ADDRESS 0x0002
|
---|
| 68 | #define DS_PDC_FLAG 0x00000001
|
---|
| 69 | #define DS_GC_FLAG 0x00000004
|
---|
| 70 | #define DS_DS_FLAG 0x00000010
|
---|
| 71 | #define DS_KDC_FLAG 0x00000020
|
---|
| 72 | #define DS_TIMESERV_FLAG 0x00000040
|
---|
| 73 | #define DS_WRITABLE_FLAG 0x00000100
|
---|
| 74 | #define DS_DNS_CONTROLLER_FLAG 0x20000000
|
---|
| 75 | #define DS_DNS_DOMAIN_FLAG 0x40000000
|
---|
| 76 | #define DS_DNS_FOREST_FLAG 0x80000000
|
---|
| 77 | typedef struct _DS_DOMAIN_TRUSTSA {
|
---|
| 78 | LPSTR NetbiosDomainName;
|
---|
| 79 | LPSTR DnsDomainName;
|
---|
| 80 | ULONG Flags;
|
---|
| 81 | ULONG ParentIndex;
|
---|
| 82 | ULONG TrustType;
|
---|
| 83 | ULONG TrustAttributes;
|
---|
| 84 | PSID DomainSid;
|
---|
| 85 | GUID DomainGuid;
|
---|
| 86 | } DS_DOMAIN_TRUSTSA,*PDS_DOMAIN_TRUSTSA;
|
---|
| 87 | typedef struct _DS_DOMAIN_TRUSTSW {
|
---|
| 88 | LPWSTR NetbiosDomainName;
|
---|
| 89 | LPWSTR DnsDomainName;
|
---|
| 90 | ULONG Flags;
|
---|
| 91 | ULONG ParentIndex;
|
---|
| 92 | ULONG TrustType;
|
---|
| 93 | ULONG TrustAttributes;
|
---|
| 94 | PSID DomainSid;
|
---|
| 95 | GUID DomainGuid;
|
---|
| 96 | } DS_DOMAIN_TRUSTSW,*PDS_DOMAIN_TRUSTSW;
|
---|
| 97 | #define DS_DOMAIN_IN_FOREST 0x0001
|
---|
| 98 | #define DS_DOMAIN_DIRECT_OUTBOUND 0x0002
|
---|
| 99 | #define DS_DOMAIN_TREE_ROOT 0x0004
|
---|
| 100 | #define DS_DOMAIN_PRIMARY 0x0008
|
---|
| 101 | #define DS_DOMAIN_NATIVE_MODE 0x0010
|
---|
| 102 | #define DS_DOMAIN_DIRECT_INBOUND 0x0020
|
---|
| 103 |
|
---|
| 104 | DWORD WINAPI DsGetDcNameW(LPCWSTR, LPCWSTR, GUID*, LPCWSTR, ULONG, PDOMAIN_CONTROLLER_INFOW*);
|
---|
| 105 | DWORD WINAPI DsGetDcNameA(LPCSTR, LPCSTR, GUID*, LPCSTR, ULONG, PDOMAIN_CONTROLLER_INFOA*);
|
---|
| 106 |
|
---|
| 107 | #ifdef UNICODE
|
---|
| 108 | typedef DOMAIN_CONTROLLER_INFOW DOMAIN_CONTROLLER_INFO,*PDOMAIN_CONTROLLER_INFO;
|
---|
| 109 | typedef DS_DOMAIN_TRUSTSW DS_DOMAIN_TRUSTS,*PDS_DOMAIN_TRUSTS;
|
---|
| 110 | #define DsGetDcName DsGetDcNameW
|
---|
| 111 | #else
|
---|
| 112 | typedef DOMAIN_CONTROLLER_INFOA DOMAIN_CONTROLLER_INFO,*PDOMAIN_CONTROLLER_INFO;
|
---|
| 113 | typedef DS_DOMAIN_TRUSTSA DS_DOMAIN_TRUSTS,*PDS_DOMAIN_TRUSTS;
|
---|
| 114 | #define DsGetDcName DsGetDcNameA
|
---|
| 115 | #endif
|
---|
| 116 | #endif /* (_WIN32_WINNT >= 0x0500) */
|
---|
| 117 |
|
---|
| 118 | #ifdef __cplusplus
|
---|
| 119 | }
|
---|
| 120 | #endif
|
---|
| 121 | #endif
|
---|