4 #pragma GCC system_header
11 #define DNS_QUERY_STANDARD 0x0
12 #define DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE 0x1
13 #define DNS_QUERY_USE_TCP_ONLY 0x2
14 #define DNS_QUERY_NO_RECURSION 0x4
15 #define DNS_QUERY_BYPASS_CACHE 0x8
16 #define DNS_QUERY_NO_WIRE_QUERY 0x10
17 #define DNS_QUERY_NO_LOCAL_NAME 0x20
18 #define DNS_QUERY_NO_HOSTS_FILE 0x40
19 #define DNS_QUERY_NO_NETBT 0x80
20 #define DNS_QUERY_TREAT_AS_FQDN 0x1000
21 #define DNS_QUERY_WIRE_ONLY 0x100
22 #define DNS_QUERY_RETURN_MESSAGE 0x200
23 #define DNS_QUERY_DONT_RESET_TTL_VALUES 0x100000
24 #define DNS_QUERY_RESERVED 0xff000000
26 #define DNS_UPDATE_SECURITY_USE_DEFAULT 0x0
27 #define DNS_UPDATE_SECURITY_OFF 0x10
28 #define DNS_UPDATE_SECURITY_ON 0x20
29 #define DNS_UPDATE_SECURITY_ONLY 0x100
30 #define DNS_UPDATE_CACHE_SECURITY_CONTEXT 0x200
31 #define DNS_UPDATE_TEST_USE_LOCAL_SYS_ACCT 0x400
32 #define DNS_UPDATE_FORCE_SECURITY_NEGO 0x800
33 #define DNS_UPDATE_RESERVED 0xffff0000
36 typedef DWORD IP4_ADDRESS
;
37 typedef DWORD DNS_STATUS
;
92 DNS_TYPE_ANY
=DNS_TYPE_ALL
94 typedef enum _DNS_CHARSET
103 DnsConfigPrimaryDomainName_W
,
104 DnsConfigPrimaryDomainName_A
,
105 DnsConfigPrimaryDomainName_UTF8
,
106 DnsConfigAdapterDomainName_W
,
107 DnsConfigAdapterDomainName_A
,
108 DnsConfigAdapterDomainName_UTF8
,
109 DnsConfigDnsServerList
,
111 DnsConfigAdapterInfo
,
112 DnsConfigPrimaryHostNameRegistrationEnabled
,
113 DnsConfigAdapterHostNameRegistrationEnabled
,
114 DnsConfigAddressRegistrationMaxCount
,
117 DnsConfigHostName_UTF8
,
118 DnsConfigFullHostName_W
,
119 DnsConfigFullHostName_A
,
120 DnsConfigFullHostName_UTF8
126 DnsFreeParsedMessageFields
128 typedef enum _DNS_NAME_FORMAT
133 DnsNameHostnameLabel
,
144 typedef struct _IP4_ARRAY
{
146 IP4_ADDRESS AddrArray
[1];
147 } IP4_ARRAY
, *PIP4_ARRAY
;
150 } IP6_ADDRESS
, *PIP6_ADDRESS
, DNS_IP6_ADDRESS
, *PDNS_IP6_ADDRESS
;
151 typedef struct _DNS_HEADER
{
153 BYTE RecursionDesired
;
160 BYTE RecursionAvailable
;
163 WORD NameServerCount
;
164 WORD AdditionalCount
;
165 } DNS_HEADER
, *PDNS_HEADER
;
166 typedef struct _DNS_MESSAGE_BUFFER
{
167 DNS_HEADER MessageHead
;
169 } DNS_MESSAGE_BUFFER
, *PDNS_MESSAGE_BUFFER
;
170 typedef struct _DnsRecordFlags
{
177 #define DNSREC_QUESTION 0
178 #define DNSREC_ANSWER 1
179 #define DNSREC_AUTHORITY 2
180 #define DNSREC_ADDITIONAL 3
182 IP4_ADDRESS IpAddress
;
183 } DNS_A_DATA
, *PDNS_A_DATA
;
185 DNS_IP6_ADDRESS Ip6Address
;
186 } DNS_AAAA_DATA
, *PDNS_AAAA_DATA
;
187 #define DNS_ATMA_MAX_ADDR_LENGTH 20
190 BYTE Address
[DNS_ATMA_MAX_ADDR_LENGTH
];
191 } DNS_ATMA_DATA
, *PDNS_ATMA_DATA
;
197 } DNS_KEY_DATA
, *PDNS_KEY_DATA
;
206 } DNS_LOC_DATA
, *PDNS_LOC_DATA
;
209 LPTSTR pNameErrorsMailbox
;
210 } DNS_MINFO_DATA
, *PDNS_MINFO_DATA
;
212 LPTSTR pNameExchange
;
215 } DNS_MX_DATA
, *PDNS_MX_DATA
;
219 } DNS_NULL_DATA
, *PDNS_NULL_DATA
;
224 } DNS_NXT_DATA
, *PDNS_NXT_DATA
;
227 } DNS_PTR_DATA
, *PDNS_PTR_DATA
;
239 } DNS_SIG_DATA
, *PDNS_SIG_DATA
;
241 LPTSTR pNamePrimaryServer
;
242 LPTSTR pNameAdministrator
;
248 } DNS_SOA_DATA
, *PDNS_SOA_DATA
;
255 } DNS_SRV_DATA
, *PDNS_SRV_DATA
;
258 LPTSTR pStringArray
[1];
259 } DNS_TXT_DATA
, *PDNS_TXT_DATA
;
261 LPTSTR pNameAlgorithm
;
262 PBYTE pAlgorithmPacket
;
271 UCHAR cAlgNameLength
;
272 BOOL bPacketPointers
;
273 } DNS_TKEY_DATA
, *PDNS_TKEY_DATA
;
275 LPTSTR pNameAlgorithm
;
276 PBYTE pAlgorithmPacket
;
279 LONGLONG i64CreateTime
;
285 UCHAR cAlgNameLength
;
286 BOOL bPacketPointers
;
287 } DNS_TSIG_DATA
, *PDNS_TSIG_DATA
;
290 DWORD dwLookupTimeout
;
291 DWORD dwCacheTimeout
;
292 DWORD cWinsServerCount
;
293 IP4_ADDRESS WinsServers
[1];
294 } DNS_WINS_DATA
, *PDNS_WINS_DATA
;
297 DWORD dwLookupTimeout
;
298 DWORD dwCacheTimeout
;
299 LPTSTR pNameResultDomain
;
300 } DNS_WINSR_DATA
, *PDNS_WINSR_DATA
;
301 typedef struct _DNS_WIRE_QUESTION
{
304 } DNS_WIRE_QUESTION
, *PDNS_WIRE_QUESTION
;
305 typedef struct _DNS_WIRE_RECORD
{
310 } DNS_WIRE_RECORD
, *PDNS_WIRE_RECORD
;
312 IP4_ADDRESS IpAddress
;
315 } DNS_WKS_DATA
, *PDNS_WKS_DATA
;
316 typedef struct _DnsRecord
{
317 struct _DnsRecord
* pNext
;
329 DNS_SOA_DATA SOA
, Soa
;
330 DNS_PTR_DATA PTR
, Ptr
, NS
, Ns
, CNAME
, Cname
, MB
, Mb
,
331 MD
, Md
, MF
, Mf
, MG
, Mg
, MR
, Mr
;
332 DNS_MINFO_DATA MINFO
, Minfo
, RP
, Rp
;
333 DNS_MX_DATA MX
, Mx
, AFSDB
, Afsdb
, RT
, Rt
;
334 DNS_TXT_DATA HINFO
, Hinfo
, ISDN
, Isdn
, TXT
, Txt
, X25
;
336 DNS_WKS_DATA WKS
, Wks
;
338 DNS_KEY_DATA KEY
, Key
;
339 DNS_SIG_DATA SIG
, Sig
;
340 DNS_ATMA_DATA ATMA
, Atma
;
341 DNS_NXT_DATA NXT
, Nxt
;
342 DNS_SRV_DATA SRV
, Srv
;
343 DNS_TKEY_DATA TKEY
, Tkey
;
344 DNS_TSIG_DATA TSIG
, Tsig
;
345 DNS_WINS_DATA WINS
, Wins
;
346 DNS_WINSR_DATA WINSR
, WinsR
, NBSTAT
, Nbstat
;
348 } DNS_RECORD
, *PDNS_RECORD
;
349 typedef struct _DnsRRSet
{
350 PDNS_RECORD pFirstRR
;
352 } DNS_RRSET
, *PDNS_RRSET
;
354 DNS_STATUS WINAPI
DnsAcquireContextHandle_A(DWORD
,PVOID
,HANDLE
*);
355 DNS_STATUS WINAPI
DnsAcquireContextHandle_W(DWORD
,PVOID
,HANDLE
*);
356 DNS_STATUS WINAPI
DnsExtractRecordsFromMessage_W(PDNS_MESSAGE_BUFFER
,WORD
,PDNS_RECORD
*);
357 DNS_STATUS WINAPI
DnsExtractRecordsFromMessage_UTF8(PDNS_MESSAGE_BUFFER
,WORD
,PDNS_RECORD
*);
358 DNS_STATUS WINAPI
DnsModifyRecordsInSet_A(PDNS_RECORD
,PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
359 DNS_STATUS WINAPI
DnsModifyRecordsInSet_W(PDNS_RECORD
,PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
360 DNS_STATUS WINAPI
DnsModifyRecordsInSet_UTF8(PDNS_RECORD
,PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
361 BOOL WINAPI
DnsNameCompare_A(LPSTR
,LPSTR
);
362 BOOL WINAPI
DnsNameCompare_W(LPWSTR
,LPWSTR
);
363 DNS_STATUS WINAPI
DnsQuery_A(PCSTR
,WORD
,DWORD
,PIP4_ARRAY
,PDNS_RECORD
*,PVOID
*);
364 DNS_STATUS WINAPI
DnsQuery_W(PCWSTR
,WORD
,DWORD
,PIP4_ARRAY
,PDNS_RECORD
*,PVOID
*);
365 DNS_STATUS WINAPI
DnsQuery_UTF8(PCSTR
,WORD
,DWORD
,PIP4_ARRAY
,PDNS_RECORD
*,PVOID
*);
366 DNS_STATUS WINAPI
DnsQueryConfig(DNS_CONFIG_TYPE
,DWORD
,PWSTR
,PVOID
,PVOID
,PDWORD
);
367 BOOL WINAPI
DnsRecordCompare(PDNS_RECORD
,PDNS_RECORD
);
368 PDNS_RECORD WINAPI
DnsRecordCopyEx(PDNS_RECORD
,DNS_CHARSET
,DNS_CHARSET
);
369 void WINAPI
DnsRecordListFree(PDNS_RECORD
,DNS_FREE_TYPE
);
370 BOOL WINAPI
DnsRecordSetCompare(PDNS_RECORD
,PDNS_RECORD
,PDNS_RECORD
*,PDNS_RECORD
*);
371 PDNS_RECORD WINAPI
DnsRecordSetCopyEx(PDNS_RECORD
,DNS_CHARSET
,DNS_CHARSET
);
372 PDNS_RECORD WINAPI
DnsRecordSetDetach(PDNS_RECORD
);
373 void WINAPI
DnsReleaseContextHandle(HANDLE
);
374 DNS_STATUS WINAPI
DnsReplaceRecordSetA(PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
375 DNS_STATUS WINAPI
DnsReplaceRecordSetW(PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
376 DNS_STATUS WINAPI
DnsReplaceRecordSetUTF8(PDNS_RECORD
,DWORD
,HANDLE
,PIP4_ARRAY
,PVOID
);
377 DNS_STATUS WINAPI
DnsValidateName_A(LPCSTR
,DNS_NAME_FORMAT
);
378 DNS_STATUS WINAPI
DnsValidateName_W(LPCWSTR
, DNS_NAME_FORMAT
);
379 DNS_STATUS WINAPI
DnsValidateName_UTF8(LPCSTR
,DNS_NAME_FORMAT
);
380 BOOL WINAPI
DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER
,LPDWORD
,LPWSTR
,WORD
,WORD
,BOOL
);
381 BOOL WINAPI
DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER
,LPDWORD
,LPSTR
,WORD
,WORD
,BOOL
);
384 #define DnsAcquireContextHandle DnsAcquireContextHandle_W
385 #define DnsModifyRecordsInSet DnsModifyRecordsInSet_W
386 #define DnsNameCompare DnsNameCompare_W
387 #define DnsQuery DnsQuery_W
388 #define DnsReplaceRecordSet DnsReplaceRecordSetW
389 #define DnsValidateName DnsValidateName_W
391 #define DnsAcquireContextHandle DnsAcquireContextHandle_A
392 #define DnsModifyRecordsInSet DnsModifyRecordsInSet_A
393 #define DnsNameCompare DnsNameCompare_A
394 #define DnsQuery DnsQuery_A
395 #define DnsReplaceRecordSet DnsReplaceRecordSetA
396 #define DnsValidateName DnsValidateName_A
399 #endif /* RC_INVOKED */
405 #endif /* _WINDNS_H */