ntdll: Store stack pointer in x86_64 syscall frame.
[wine/zf.git] / include / windns.h
blob26d37165ce1f36aed43ba8db913b74991101e1a2
1 /*
2 * DNS support
4 * Copyright (C) 2006 Matthew Kehrer
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINDNS_H
22 #define __WINE_WINDNS_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 #define DNS_TYPE_ZERO 0x0000
29 #define DNS_TYPE_A 0x0001
30 #define DNS_TYPE_NS 0x0002
31 #define DNS_TYPE_MD 0x0003
32 #define DNS_TYPE_MF 0x0004
33 #define DNS_TYPE_CNAME 0x0005
34 #define DNS_TYPE_SOA 0x0006
35 #define DNS_TYPE_MB 0x0007
36 #define DNS_TYPE_MG 0x0008
37 #define DNS_TYPE_MR 0x0009
38 #define DNS_TYPE_NULL 0x000a
39 #define DNS_TYPE_WKS 0x000b
40 #define DNS_TYPE_PTR 0x000c
41 #define DNS_TYPE_HINFO 0x000d
42 #define DNS_TYPE_MINFO 0x000e
43 #define DNS_TYPE_MX 0x000f
44 #define DNS_TYPE_TEXT 0x0010
45 #define DNS_TYPE_RP 0x0011
46 #define DNS_TYPE_AFSDB 0x0012
47 #define DNS_TYPE_X25 0x0013
48 #define DNS_TYPE_ISDN 0x0014
49 #define DNS_TYPE_RT 0x0015
50 #define DNS_TYPE_NSAP 0x0016
51 #define DNS_TYPE_NSAPPTR 0x0017
52 #define DNS_TYPE_SIG 0x0018
53 #define DNS_TYPE_KEY 0x0019
54 #define DNS_TYPE_PX 0x001a
55 #define DNS_TYPE_GPOS 0x001b
56 #define DNS_TYPE_AAAA 0x001c
57 #define DNS_TYPE_LOC 0x001d
58 #define DNS_TYPE_NXT 0x001e
59 #define DNS_TYPE_EID 0x001f
60 #define DNS_TYPE_NIMLOC 0x0020
61 #define DNS_TYPE_SRV 0x0021
62 #define DNS_TYPE_ATMA 0x0022
63 #define DNS_TYPE_NAPTR 0x0023
64 #define DNS_TYPE_KX 0x0024
65 #define DNS_TYPE_CERT 0x0025
66 #define DNS_TYPE_A6 0x0026
67 #define DNS_TYPE_DNAME 0x0027
68 #define DNS_TYPE_SINK 0x0028
69 #define DNS_TYPE_OPT 0x0029
70 #define DNS_TYPE_UINFO 0x0064
71 #define DNS_TYPE_UID 0x0065
72 #define DNS_TYPE_GID 0x0066
73 #define DNS_TYPE_UNSPEC 0x0067
74 #define DNS_TYPE_ADDRS 0x00f8
75 #define DNS_TYPE_TKEY 0x00f9
76 #define DNS_TYPE_TSIG 0x00fa
77 #define DNS_TYPE_IXFR 0x00fb
78 #define DNS_TYPE_AXFR 0x00fc
79 #define DNS_TYPE_MAILB 0x00fd
80 #define DNS_TYPE_MAILA 0x00fe
81 #define DNS_TYPE_ALL 0x00ff
82 #define DNS_TYPE_ANY 0x00ff
84 #define DNS_TYPE_WINS 0xff01
85 #define DNS_TYPE_WINSR 0xff02
86 #define DNS_TYPE_NBSTAT (DNS_TYPE_WINSR)
88 #define DNS_QUERY_STANDARD 0x00000000
89 #define DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE 0x00000001
90 #define DNS_QUERY_USE_TCP_ONLY 0x00000002
91 #define DNS_QUERY_NO_RECURSION 0x00000004
92 #define DNS_QUERY_BYPASS_CACHE 0x00000008
93 #define DNS_QUERY_NO_WIRE_QUERY 0x00000010
94 #define DNS_QUERY_NO_LOCAL_NAME 0x00000020
95 #define DNS_QUERY_NO_HOSTS_FILE 0x00000040
96 #define DNS_QUERY_NO_NETBT 0x00000080
97 #define DNS_QUERY_WIRE_ONLY 0x00000100
98 #define DNS_QUERY_RETURN_MESSAGE 0x00000200
99 #define DNS_QUERY_MULTICAST_ONLY 0x00000400
100 #define DNS_QUERY_NO_MULTICAST 0x00000800
101 #define DNS_QUERY_TREAT_AS_FQDN 0x00001000
102 #define DNS_QUERY_ADDRCONFIG 0x00002000
103 #define DNS_QUERY_DUAL_ADDR 0x00004000
104 #define DNS_QUERY_DONT_RESET_TTL_VALUES 0x00100000
105 #define DNS_QUERY_DISABLE_IDN_ENCODING 0x00200000
106 #define DNS_QUERY_APPEND_MULTILABEL 0x00800000
107 #define DNS_QUERY_DNSSEC_OK 0x01000000
108 #define DNS_QUERY_DNSSEC_CHECKING_DISABLED 0x02000000
109 #define DNS_QUERY_RESERVED 0xff000000
111 typedef enum _DNS_NAME_FORMAT
113 DnsNameDomain,
114 DnsNameDomainLabel,
115 DnsNameHostnameFull,
116 DnsNameHostnameLabel,
117 DnsNameWildcard,
118 DnsNameSrvRecord
119 } DNS_NAME_FORMAT;
121 typedef enum _DNS_FREE_TYPE
123 DnsFreeFlat,
124 DnsFreeRecordList,
125 DnsFreeParsedMessageFields
126 } DNS_FREE_TYPE;
128 typedef enum _DNS_CHARSET
130 DnsCharSetUnknown,
131 DnsCharSetUnicode,
132 DnsCharSetUtf8,
133 DnsCharSetAnsi
134 } DNS_CHARSET;
136 typedef enum _DNS_CONFIG_TYPE
138 DnsConfigPrimaryDomainName_W,
139 DnsConfigPrimaryDomainName_A,
140 DnsConfigPrimaryDomainName_UTF8,
141 DnsConfigAdapterDomainName_W,
142 DnsConfigAdapterDomainName_A,
143 DnsConfigAdapterDomainName_UTF8,
144 DnsConfigDnsServerList,
145 DnsConfigSearchList,
146 DnsConfigAdapterInfo,
147 DnsConfigPrimaryHostNameRegistrationEnabled,
148 DnsConfigAdapterHostNameRegistrationEnabled,
149 DnsConfigAddressRegistrationMaxCount,
150 DnsConfigHostName_W,
151 DnsConfigHostName_A,
152 DnsConfigHostName_UTF8,
153 DnsConfigFullHostName_W,
154 DnsConfigFullHostName_A,
155 DnsConfigFullHostName_UTF8
156 } DNS_CONFIG_TYPE;
158 typedef enum _DnsSection
160 DnsSectionQuestion,
161 DnsSectionAnswer,
162 DnsSectionAuthority,
163 DnsSectionAddtional /* Not a typo, as per Microsoft's headers */
164 } DNS_SECTION;
166 typedef LONG DNS_STATUS, *PDNS_STATUS;
167 typedef DWORD IP4_ADDRESS, *PIP4_ADDRESS;
169 typedef struct
171 DWORD IP6Dword[4];
172 } IP6_ADDRESS, *PIP6_ADDRESS, DNS_IP6_ADDRESS, *PDNS_IP6_ADDRESS;
174 #define SIZEOF_IP4_ADDRESS 4
175 #define IP4_ADDRESS_STRING_LENGTH 16
176 #define IP6_ADDRESS_STRING_LENGTH 65
177 #define DNS_ADDRESS_STRING_LENGTH IP6_ADDRESS_STRING_LENGTH
178 #define IP4_ADDRESS_STRING_BUFFER_LENGTH IP4_ADDRESS_STRING_LENGTH
179 #define IP6_ADDRESS_STRING_BUFFER_LENGTH IP6_ADDRESS_STRING_LENGTH
180 #define DNS_MAX_NAME_BUFFER_LENGTH 256
182 typedef struct _IP4_ARRAY
184 DWORD AddrCount;
185 IP4_ADDRESS AddrArray[1];
186 } IP4_ARRAY, *PIP4_ARRAY;
188 #include <pshpack1.h>
189 typedef struct _DNS_HEADER
191 WORD Xid;
192 BYTE RecursionDesired:1;
193 BYTE Truncation:1;
194 BYTE Authoritative:1;
195 BYTE Opcode:4;
196 BYTE IsResponse:1;
197 BYTE ResponseCode:4;
198 BYTE CheckingDisabled:1;
199 BYTE AuthenticatedData:1;
200 BYTE Reserved:1;
201 BYTE RecursionAvailable:1;
202 WORD QuestionCount;
203 WORD AnswerCount;
204 WORD NameServerCount;
205 WORD AdditionalCount;
206 } DNS_HEADER, *PDNS_HEADER;
207 #include <poppack.h>
209 typedef struct _DNS_MESSAGE_BUFFER
211 DNS_HEADER MessageHead;
212 CHAR MessageBody[1];
213 } DNS_MESSAGE_BUFFER, *PDNS_MESSAGE_BUFFER;
215 typedef struct
217 IP4_ADDRESS IpAddress;
218 } DNS_A_DATA, *PDNS_A_DATA;
220 typedef struct _DnsRecordFlags
222 DWORD Section :2;
223 DWORD Delete :1;
224 DWORD CharSet :2;
225 DWORD Unused :3;
226 DWORD Reserved :24;
227 } DNS_RECORD_FLAGS;
229 typedef struct
231 PSTR pNamePrimaryServer;
232 PSTR pNameAdministrator;
233 DWORD dwSerialNo;
234 DWORD dwRefresh;
235 DWORD dwRetry;
236 DWORD dwExpire;
237 DWORD dwDefaultTtl;
238 } DNS_SOA_DATAA, *PDNS_SOA_DATAA;
240 typedef struct
242 PWSTR pNamePrimaryServer;
243 PWSTR pNameAdministrator;
244 DWORD dwSerialNo;
245 DWORD dwRefresh;
246 DWORD dwRetry;
247 DWORD dwExpire;
248 DWORD dwDefaultTtl;
249 } DNS_SOA_DATAW, *PDNS_SOA_DATAW;
251 DECL_WINELIB_TYPE_AW(DNS_SOA_DATA)
252 DECL_WINELIB_TYPE_AW(PDNS_SOA_DATA)
254 typedef struct
256 PSTR pNameHost;
257 } DNS_PTR_DATAA, *PDNS_PTR_DATAA;
259 typedef struct
261 PWSTR pNameHost;
262 } DNS_PTR_DATAW, *PDNS_PTR_DATAW;
264 DECL_WINELIB_TYPE_AW(DNS_PTR_DATA)
265 DECL_WINELIB_TYPE_AW(PDNS_PTR_DATA)
267 typedef struct
269 PSTR pNameMailbox;
270 PSTR pNameErrorsMailbox;
271 } DNS_MINFO_DATAA, *PDNS_MINFO_DATAA;
273 typedef struct
275 PWSTR pNameMailbox;
276 PWSTR pNameErrorsMailbox;
277 } DNS_MINFO_DATAW, *PDNS_MINFO_DATAW;
279 DECL_WINELIB_TYPE_AW(DNS_MINFO_DATA)
280 DECL_WINELIB_TYPE_AW(PDNS_MINFO_DATA)
282 typedef struct
284 PSTR pNameExchange;
285 WORD wPreference;
286 WORD Pad;
287 } DNS_MX_DATAA, *PDNS_MX_DATAA;
289 typedef struct
291 PWSTR pNameExchange;
292 WORD wPreference;
293 WORD Pad;
294 } DNS_MX_DATAW, *PDNS_MX_DATAW;
296 DECL_WINELIB_TYPE_AW(DNS_MX_DATA)
297 DECL_WINELIB_TYPE_AW(PDNS_MX_DATA)
299 typedef struct
301 DWORD dwStringCount;
302 PSTR pStringArray[1];
303 } DNS_TXT_DATAA, *PDNS_TXT_DATAA;
305 typedef struct
307 DWORD dwStringCount;
308 PWSTR pStringArray[1];
309 } DNS_TXT_DATAW, *PDNS_TXT_DATAW;
311 DECL_WINELIB_TYPE_AW(DNS_TXT_DATA)
312 DECL_WINELIB_TYPE_AW(PDNS_TXT_DATA)
314 typedef struct
316 DWORD dwByteCount;
317 BYTE Data[1];
318 } DNS_NULL_DATA, *PDNS_NULL_DATA;
320 typedef struct
322 IP4_ADDRESS IpAddress;
323 UCHAR chProtocol;
324 BYTE BitMask[1];
325 } DNS_WKS_DATA, *PDNS_WKS_DATA;
327 typedef struct
329 DNS_IP6_ADDRESS Ip6Address;
330 } DNS_AAAA_DATA, *PDNS_AAAA_DATA;
332 typedef struct
334 WORD wFlags;
335 BYTE chProtocol;
336 BYTE chAlgorithm;
337 BYTE Key[1];
338 } DNS_KEY_DATA, *PDNS_KEY_DATA;
340 typedef struct
342 WORD wVersion;
343 WORD wSize;
344 WORD wHorPrec;
345 WORD wVerPrec;
346 DWORD dwLatitude;
347 DWORD dwLongitude;
348 DWORD dwAltitude;
349 } DNS_LOC_DATA, *PDNS_LOC_DATA;
351 typedef struct
353 PSTR pNameSigner;
354 WORD wTypeCovered;
355 BYTE chAlgorithm;
356 BYTE chLabelCount;
357 DWORD dwOriginalTtl;
358 DWORD dwExpiration;
359 DWORD dwTimeSigned;
360 WORD wKeyTag;
361 WORD Pad;
362 BYTE Signature[1];
363 } DNS_SIG_DATAA, *PDNS_SIG_DATAA;
365 typedef struct
367 PWSTR pNameSigner;
368 WORD wTypeCovered;
369 BYTE chAlgorithm;
370 BYTE chLabelCount;
371 DWORD dwOriginalTtl;
372 DWORD dwExpiration;
373 DWORD dwTimeSigned;
374 WORD wKeyTag;
375 WORD Pad;
376 BYTE Signature[1];
377 } DNS_SIG_DATAW, *PDNS_SIG_DATAW;
379 DECL_WINELIB_TYPE_AW(DNS_SIG_DATA)
380 DECL_WINELIB_TYPE_AW(PDNS_SIG_DATA)
382 #define DNS_ATMA_MAX_ADDR_LENGTH 20
384 typedef struct
386 BYTE AddressType;
387 BYTE Address[DNS_ATMA_MAX_ADDR_LENGTH];
388 } DNS_ATMA_DATA, *PDNS_ATMA_DATA;
390 typedef struct
392 PSTR pNameNext;
393 WORD wNumTypes;
394 WORD wTypes[1];
395 } DNS_NXT_DATAA, *PDNS_NXT_DATAA;
397 typedef struct
399 PWSTR pNameNext;
400 WORD wNumTypes;
401 WORD wTypes[1];
402 } DNS_NXT_DATAW, *PDNS_NXT_DATAW;
404 DECL_WINELIB_TYPE_AW(DNS_NXT_DATA)
405 DECL_WINELIB_TYPE_AW(PDNS_NXT_DATA)
407 typedef struct
409 PSTR pNameTarget;
410 WORD wPriority;
411 WORD wWeight;
412 WORD wPort;
413 WORD Pad;
414 } DNS_SRV_DATAA, *PDNS_SRV_DATAA;
416 typedef struct
418 PWSTR pNameTarget;
419 WORD wPriority;
420 WORD wWeight;
421 WORD wPort;
422 WORD Pad;
423 } DNS_SRV_DATAW, *PDNS_SRV_DATAW;
425 DECL_WINELIB_TYPE_AW(DNS_SRV_DATA)
426 DECL_WINELIB_TYPE_AW(PDNS_SRV_DATA)
428 typedef struct
430 PSTR pNameAlgorithm;
431 PBYTE pAlgorithmPacket;
432 PBYTE pKey;
433 PBYTE pOtherData;
434 DWORD dwCreateTime;
435 DWORD dwExpireTime;
436 WORD wMode;
437 WORD wError;
438 WORD wKeyLength;
439 WORD wOtherLength;
440 UCHAR cAlgNameLength;
441 BOOL bPacketPointers;
442 } DNS_TKEY_DATAA, *PDNS_TKEY_DATAA;
444 typedef struct
446 PWSTR pNameAlgorithm;
447 PBYTE pAlgorithmPacket;
448 PBYTE pKey;
449 PBYTE pOtherData;
450 DWORD dwCreateTime;
451 DWORD dwExpireTime;
452 WORD wMode;
453 WORD wError;
454 WORD wKeyLength;
455 WORD wOtherLength;
456 UCHAR cAlgNameLength;
457 BOOL bPacketPointers;
458 } DNS_TKEY_DATAW, *PDNS_TKEY_DATAW;
460 DECL_WINELIB_TYPE_AW(DNS_TKEY_DATA)
461 DECL_WINELIB_TYPE_AW(PDNS_TKEY_DATA)
463 typedef struct
465 PSTR pNameAlgorithm;
466 PBYTE pAlgorithmPacket;
467 PBYTE pSignature;
468 PBYTE pOtherData;
469 LONGLONG i64CreateTime;
470 WORD wFudgeTime;
471 WORD wOriginalXid;
472 WORD wError;
473 WORD wSigLength;
474 WORD wOtherLength;
475 UCHAR cAlgNameLength;
476 BOOL bPacketPointers;
477 } DNS_TSIG_DATAA, *PDNS_TSIG_DATAA;
479 typedef struct
481 PWSTR pNameAlgorithm;
482 PBYTE pAlgorithmPacket;
483 PBYTE pSignature;
484 PBYTE pOtherData;
485 LONGLONG i64CreateTime;
486 WORD wFudgeTime;
487 WORD wOriginalXid;
488 WORD wError;
489 WORD wSigLength;
490 WORD wOtherLength;
491 UCHAR cAlgNameLength;
492 BOOL bPacketPointers;
493 } DNS_TSIG_DATAW, *PDNS_TSIG_DATAW;
495 typedef struct
497 DWORD dwMappingFlag;
498 DWORD dwLookupTimeout;
499 DWORD dwCacheTimeout;
500 DWORD cWinsServerCount;
501 IP4_ADDRESS WinsServers[1];
502 } DNS_WINS_DATA, *PDNS_WINS_DATA;
504 typedef struct
506 DWORD dwMappingFlag;
507 DWORD dwLookupTimeout;
508 DWORD dwCacheTimeout;
509 PSTR pNameResultDomain;
510 } DNS_WINSR_DATAA, *PDNS_WINSR_DATAA;
512 typedef struct
514 DWORD dwMappingFlag;
515 DWORD dwLookupTimeout;
516 DWORD dwCacheTimeout;
517 PWSTR pNameResultDomain;
518 } DNS_WINSR_DATAW, *PDNS_WINSR_DATAW;
520 DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA)
521 DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA)
523 typedef struct
525 WORD wDataLength;
526 WORD wPad;
527 BYTE Data[1];
529 DNS_OPT_DATA, *PDNS_OPT_DATA;
531 typedef struct _DnsRecordA
533 struct _DnsRecordA *pNext;
534 PSTR pName;
535 WORD wType;
536 WORD wDataLength;
537 union
539 DWORD DW;
540 DNS_RECORD_FLAGS S;
541 } Flags;
542 DWORD dwTtl;
543 DWORD dwReserved;
544 union
546 DNS_A_DATA A;
547 DNS_SOA_DATAA SOA, Soa;
548 DNS_PTR_DATAA PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
549 DNS_MINFO_DATAA MINFO, Minfo, RP, Rp;
550 DNS_MX_DATAA MX, Mx, AFSDB, Afsdb, RT, Rt;
551 DNS_TXT_DATAA HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
552 DNS_NULL_DATA Null;
553 DNS_WKS_DATA WKS, Wks;
554 DNS_AAAA_DATA AAAA;
555 DNS_KEY_DATA KEY, Key;
556 DNS_SIG_DATAA SIG, Sig;
557 DNS_ATMA_DATA ATMA, Atma;
558 DNS_NXT_DATAA NXT, Nxt;
559 DNS_SRV_DATAA SRV, Srv;
560 DNS_TKEY_DATAA TKEY, Tkey;
561 DNS_TSIG_DATAA TSIG, Tsig;
562 DNS_WINS_DATA WINS, Wins;
563 DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
564 DNS_OPT_DATA OPT, Opt;
565 } Data;
566 } DNS_RECORDA, *PDNS_RECORDA;
568 typedef struct _DnsRecordW
570 struct _DnsRecordW *pNext;
571 PWSTR pName;
572 WORD wType;
573 WORD wDataLength;
574 union
576 DWORD DW;
577 DNS_RECORD_FLAGS S;
578 } Flags;
579 DWORD dwTtl;
580 DWORD dwReserved;
581 union
583 DNS_A_DATA A;
584 DNS_SOA_DATAW SOA, Soa;
585 DNS_PTR_DATAW PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
586 DNS_MINFO_DATAW MINFO, Minfo, RP, Rp;
587 DNS_MX_DATAW MX, Mx, AFSDB, Afsdb, RT, Rt;
588 DNS_TXT_DATAW HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
589 DNS_NULL_DATA Null;
590 DNS_WKS_DATA WKS, Wks;
591 DNS_AAAA_DATA AAAA;
592 DNS_KEY_DATA KEY, Key;
593 DNS_SIG_DATAW SIG, Sig;
594 DNS_ATMA_DATA ATMA, Atma;
595 DNS_NXT_DATAW NXT, Nxt;
596 DNS_SRV_DATAW SRV, Srv;
597 DNS_TKEY_DATAW TKEY, Tkey;
598 DNS_TSIG_DATAW TSIG, Tsig;
599 DNS_WINS_DATA WINS, Wins;
600 DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
601 DNS_OPT_DATA OPT, Opt;
602 } Data;
603 } DNS_RECORDW, *PDNS_RECORDW;
605 #if defined(__WINESRC__) || defined(UNICODE)
606 typedef DNS_RECORDW DNS_RECORD;
607 typedef PDNS_RECORDW PDNS_RECORD;
608 #else
609 typedef DNS_RECORDA DNS_RECORD;
610 typedef PDNS_RECORDA PDNS_RECORD;
611 #endif
613 typedef struct _DnsRRSet
615 PDNS_RECORD pFirstRR;
616 PDNS_RECORD pLastRR;
617 } DNS_RRSET, *PDNS_RRSET;
619 #define DNS_RRSET_INIT( rrset ) \
621 PDNS_RRSET _prrset = &(rrset); \
622 _prrset->pFirstRR = NULL; \
623 _prrset->pLastRR = (PDNS_RECORD) &_prrset->pFirstRR; \
626 #define DNS_RRSET_ADD( rrset, pnewRR ) \
628 PDNS_RRSET _prrset = &(rrset); \
629 PDNS_RECORD _prrnew = (pnewRR); \
630 _prrset->pLastRR->pNext = _prrnew; \
631 _prrset->pLastRR = _prrnew; \
634 #define DNS_RRSET_TERMINATE( rrset ) \
636 PDNS_RRSET _prrset = &(rrset); \
637 _prrset->pLastRR->pNext = NULL; \
640 #define DNS_ADDR_MAX_SOCKADDR_LENGTH 32
642 #include <pshpack1.h>
644 typedef struct _DnsAddr
646 char MaxSa[DNS_ADDR_MAX_SOCKADDR_LENGTH];
647 union {
648 DWORD DnsAddrUserDword[8];
649 } Data;
650 } DNS_ADDR, *PDNS_ADDR;
652 typedef struct _DnsAddrArray
654 DWORD MaxCount;
655 DWORD AddrCount;
656 DWORD Tag;
657 WORD Family;
658 WORD WordReserved;
659 DWORD Flags;
660 DWORD MatchFlag;
661 DWORD Reserved1;
662 DWORD Reserved2;
663 DNS_ADDR AddrArray[1];
664 } DNS_ADDR_ARRAY, *PDNS_ADDR_ARRAY;
666 #include <poppack.h>
668 #define DNS_QUERY_RESULTS_VERSION1 0x1
670 typedef struct _DNS_QUERY_RESULT
672 ULONG Version;
673 DNS_STATUS QueryStatus;
674 ULONG64 QueryOptions;
675 DNS_RECORD *pQueryRecords;
676 void *Reserved;
677 } DNS_QUERY_RESULT, *PDNS_QUERY_RESULT;
679 typedef void WINAPI DNS_QUERY_COMPLETION_ROUTINE(void*,DNS_QUERY_RESULT*);
680 typedef DNS_QUERY_COMPLETION_ROUTINE *PDNS_QUERY_COMPLETION_ROUTINE;
682 #define DNS_QUERY_REQUEST_VERSION1 0x1
684 typedef struct _DNS_QUERY_REQUEST
686 ULONG Version;
687 const WCHAR *QueryName;
688 WORD QueryType;
689 ULONG64 QueryOptions;
690 PDNS_ADDR_ARRAY pDnsServerList;
691 ULONG InterfaceIndex;
692 PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback;
693 void *pQueryContext;
694 } DNS_QUERY_REQUEST, *PDNS_QUERY_REQUEST;
696 typedef struct _DNS_QUERY_CANCEL
698 char Reserved[32];
699 } DNS_QUERY_CANCEL, *PDNS_QUERY_CANCEL;
701 typedef struct _DNS_CACHE_ENTRY
703 struct _DNS_CACHE_ENTRY* Next;
704 const WCHAR *Name;
705 WORD Type;
706 WORD DataLength;
707 ULONG Flags;
708 } DNS_CACHE_ENTRY, *PDNS_CACHE_ENTRY;
710 DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE);
711 DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE);
712 #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_)
713 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_W(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDW*);
714 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_UTF8(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDA*);
715 VOID WINAPI DnsFree(PVOID,DNS_FREE_TYPE);
716 DNS_STATUS WINAPI DnsModifyRecordsInSet_A(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
717 DNS_STATUS WINAPI DnsModifyRecordsInSet_W(PDNS_RECORDW,PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
718 DNS_STATUS WINAPI DnsModifyRecordsInSet_UTF8(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
719 #define DnsModifyRecordsInSet WINELIB_NAME_AW(DnsModifyRecordsInSet_)
720 BOOL WINAPI DnsNameCompare_A(PCSTR,PCSTR);
721 BOOL WINAPI DnsNameCompare_W(PCWSTR,PCWSTR);
722 #define DnsNameCompare WINELIB_NAME_AW(DnsNameCompare_)
723 DNS_STATUS WINAPI DnsQuery_A(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
724 DNS_STATUS WINAPI DnsQuery_W(PCWSTR,WORD,DWORD,PVOID,PDNS_RECORDW*,PVOID*);
725 DNS_STATUS WINAPI DnsQuery_UTF8(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
726 #define DnsQuery WINELIB_NAME_AW(DnsQuery_)
727 DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST*,DNS_QUERY_RESULT*,DNS_QUERY_CANCEL*);
728 DNS_STATUS WINAPI DnsCancelQuery(DNS_QUERY_CANCEL*);
729 DNS_STATUS WINAPI DnsQueryConfig(DNS_CONFIG_TYPE,DWORD,PCWSTR,PVOID,PVOID,PDWORD);
730 BOOL WINAPI DnsRecordCompare(PDNS_RECORD,PDNS_RECORD);
731 PDNS_RECORD WINAPI DnsRecordCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
732 VOID WINAPI DnsRecordListFree(PDNS_RECORD,DNS_FREE_TYPE);
733 BOOL WINAPI DnsRecordSetCompare(PDNS_RECORD,PDNS_RECORD,PDNS_RECORD*,PDNS_RECORD*);
734 PDNS_RECORD WINAPI DnsRecordSetCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
735 PDNS_RECORD WINAPI DnsRecordSetDetach(PDNS_RECORD);
736 void WINAPI DnsReleaseContextHandle(HANDLE);
737 DNS_STATUS WINAPI DnsReplaceRecordSetA(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
738 DNS_STATUS WINAPI DnsReplaceRecordSetW(PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
739 DNS_STATUS WINAPI DnsReplaceRecordSetUTF8(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
740 #define DnsReplaceRecordSet WINELIB_NAME_AW(DnsReplaceRecordSet)
741 DNS_STATUS WINAPI DnsValidateName_A(PCSTR,DNS_NAME_FORMAT);
742 DNS_STATUS WINAPI DnsValidateName_W(PCWSTR, DNS_NAME_FORMAT);
743 DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT);
744 #define DnsValidateName WINELIB_NAME_AW(DnsValidateName_)
745 BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL);
746 BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL);
747 BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*);
749 #ifdef __cplusplus
751 #endif
753 #endif