msdasql: Add IConvertType interface for ICommandText.
[wine.git] / include / windns.h
blobf1f2184281c1e8ba7e5e66dc0d5408650b5deb66
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,
157 /* These are undocumented and return a DNS_ADDR_ARRAY */
158 DnsConfigDnsServersUnspec = 4144,
159 DnsConfigDnsServersIpv4,
160 DnsConfigDnsServersIpv6
161 } DNS_CONFIG_TYPE;
163 typedef enum _DnsSection
165 DnsSectionQuestion,
166 DnsSectionAnswer,
167 DnsSectionAuthority,
168 DnsSectionAddtional /* Not a typo, as per Microsoft's headers */
169 } DNS_SECTION;
171 typedef LONG DNS_STATUS, *PDNS_STATUS;
172 typedef DWORD IP4_ADDRESS, *PIP4_ADDRESS;
174 typedef struct
176 DWORD IP6Dword[4];
177 } IP6_ADDRESS, *PIP6_ADDRESS, DNS_IP6_ADDRESS, *PDNS_IP6_ADDRESS;
179 #define SIZEOF_IP4_ADDRESS 4
180 #define IP4_ADDRESS_STRING_LENGTH 16
181 #define IP6_ADDRESS_STRING_LENGTH 65
182 #define DNS_ADDRESS_STRING_LENGTH IP6_ADDRESS_STRING_LENGTH
183 #define IP4_ADDRESS_STRING_BUFFER_LENGTH IP4_ADDRESS_STRING_LENGTH
184 #define IP6_ADDRESS_STRING_BUFFER_LENGTH IP6_ADDRESS_STRING_LENGTH
185 #define DNS_MAX_NAME_BUFFER_LENGTH 256
187 typedef struct _IP4_ARRAY
189 DWORD AddrCount;
190 IP4_ADDRESS AddrArray[1];
191 } IP4_ARRAY, *PIP4_ARRAY;
193 #include <pshpack1.h>
194 typedef struct _DNS_HEADER
196 WORD Xid;
197 BYTE RecursionDesired:1;
198 BYTE Truncation:1;
199 BYTE Authoritative:1;
200 BYTE Opcode:4;
201 BYTE IsResponse:1;
202 BYTE ResponseCode:4;
203 BYTE CheckingDisabled:1;
204 BYTE AuthenticatedData:1;
205 BYTE Reserved:1;
206 BYTE RecursionAvailable:1;
207 WORD QuestionCount;
208 WORD AnswerCount;
209 WORD NameServerCount;
210 WORD AdditionalCount;
211 } DNS_HEADER, *PDNS_HEADER;
212 #include <poppack.h>
214 typedef struct _DNS_MESSAGE_BUFFER
216 DNS_HEADER MessageHead;
217 CHAR MessageBody[1];
218 } DNS_MESSAGE_BUFFER, *PDNS_MESSAGE_BUFFER;
220 typedef struct
222 IP4_ADDRESS IpAddress;
223 } DNS_A_DATA, *PDNS_A_DATA;
225 typedef struct _DnsRecordFlags
227 DWORD Section :2;
228 DWORD Delete :1;
229 DWORD CharSet :2;
230 DWORD Unused :3;
231 DWORD Reserved :24;
232 } DNS_RECORD_FLAGS;
234 typedef struct
236 PSTR pNamePrimaryServer;
237 PSTR pNameAdministrator;
238 DWORD dwSerialNo;
239 DWORD dwRefresh;
240 DWORD dwRetry;
241 DWORD dwExpire;
242 DWORD dwDefaultTtl;
243 } DNS_SOA_DATAA, *PDNS_SOA_DATAA;
245 typedef struct
247 PWSTR pNamePrimaryServer;
248 PWSTR pNameAdministrator;
249 DWORD dwSerialNo;
250 DWORD dwRefresh;
251 DWORD dwRetry;
252 DWORD dwExpire;
253 DWORD dwDefaultTtl;
254 } DNS_SOA_DATAW, *PDNS_SOA_DATAW;
256 DECL_WINELIB_TYPE_AW(DNS_SOA_DATA)
257 DECL_WINELIB_TYPE_AW(PDNS_SOA_DATA)
259 typedef struct
261 PSTR pNameHost;
262 } DNS_PTR_DATAA, *PDNS_PTR_DATAA;
264 typedef struct
266 PWSTR pNameHost;
267 } DNS_PTR_DATAW, *PDNS_PTR_DATAW;
269 DECL_WINELIB_TYPE_AW(DNS_PTR_DATA)
270 DECL_WINELIB_TYPE_AW(PDNS_PTR_DATA)
272 typedef struct
274 PSTR pNameMailbox;
275 PSTR pNameErrorsMailbox;
276 } DNS_MINFO_DATAA, *PDNS_MINFO_DATAA;
278 typedef struct
280 PWSTR pNameMailbox;
281 PWSTR pNameErrorsMailbox;
282 } DNS_MINFO_DATAW, *PDNS_MINFO_DATAW;
284 DECL_WINELIB_TYPE_AW(DNS_MINFO_DATA)
285 DECL_WINELIB_TYPE_AW(PDNS_MINFO_DATA)
287 typedef struct
289 PSTR pNameExchange;
290 WORD wPreference;
291 WORD Pad;
292 } DNS_MX_DATAA, *PDNS_MX_DATAA;
294 typedef struct
296 PWSTR pNameExchange;
297 WORD wPreference;
298 WORD Pad;
299 } DNS_MX_DATAW, *PDNS_MX_DATAW;
301 DECL_WINELIB_TYPE_AW(DNS_MX_DATA)
302 DECL_WINELIB_TYPE_AW(PDNS_MX_DATA)
304 typedef struct
306 DWORD dwStringCount;
307 PSTR pStringArray[1];
308 } DNS_TXT_DATAA, *PDNS_TXT_DATAA;
310 typedef struct
312 DWORD dwStringCount;
313 PWSTR pStringArray[1];
314 } DNS_TXT_DATAW, *PDNS_TXT_DATAW;
316 DECL_WINELIB_TYPE_AW(DNS_TXT_DATA)
317 DECL_WINELIB_TYPE_AW(PDNS_TXT_DATA)
319 typedef struct
321 DWORD dwByteCount;
322 BYTE Data[1];
323 } DNS_NULL_DATA, *PDNS_NULL_DATA;
325 typedef struct
327 IP4_ADDRESS IpAddress;
328 UCHAR chProtocol;
329 BYTE BitMask[1];
330 } DNS_WKS_DATA, *PDNS_WKS_DATA;
332 typedef struct
334 DNS_IP6_ADDRESS Ip6Address;
335 } DNS_AAAA_DATA, *PDNS_AAAA_DATA;
337 typedef struct
339 WORD wFlags;
340 BYTE chProtocol;
341 BYTE chAlgorithm;
342 BYTE Key[1];
343 } DNS_KEY_DATA, *PDNS_KEY_DATA;
345 typedef struct
347 WORD wVersion;
348 WORD wSize;
349 WORD wHorPrec;
350 WORD wVerPrec;
351 DWORD dwLatitude;
352 DWORD dwLongitude;
353 DWORD dwAltitude;
354 } DNS_LOC_DATA, *PDNS_LOC_DATA;
356 typedef struct
358 PSTR pNameSigner;
359 WORD wTypeCovered;
360 BYTE chAlgorithm;
361 BYTE chLabelCount;
362 DWORD dwOriginalTtl;
363 DWORD dwExpiration;
364 DWORD dwTimeSigned;
365 WORD wKeyTag;
366 WORD Pad;
367 BYTE Signature[1];
368 } DNS_SIG_DATAA, *PDNS_SIG_DATAA;
370 typedef struct
372 PWSTR pNameSigner;
373 WORD wTypeCovered;
374 BYTE chAlgorithm;
375 BYTE chLabelCount;
376 DWORD dwOriginalTtl;
377 DWORD dwExpiration;
378 DWORD dwTimeSigned;
379 WORD wKeyTag;
380 WORD Pad;
381 BYTE Signature[1];
382 } DNS_SIG_DATAW, *PDNS_SIG_DATAW;
384 DECL_WINELIB_TYPE_AW(DNS_SIG_DATA)
385 DECL_WINELIB_TYPE_AW(PDNS_SIG_DATA)
387 #define DNS_ATMA_MAX_ADDR_LENGTH 20
389 typedef struct
391 BYTE AddressType;
392 BYTE Address[DNS_ATMA_MAX_ADDR_LENGTH];
393 } DNS_ATMA_DATA, *PDNS_ATMA_DATA;
395 typedef struct
397 PSTR pNameNext;
398 WORD wNumTypes;
399 WORD wTypes[1];
400 } DNS_NXT_DATAA, *PDNS_NXT_DATAA;
402 typedef struct
404 PWSTR pNameNext;
405 WORD wNumTypes;
406 WORD wTypes[1];
407 } DNS_NXT_DATAW, *PDNS_NXT_DATAW;
409 DECL_WINELIB_TYPE_AW(DNS_NXT_DATA)
410 DECL_WINELIB_TYPE_AW(PDNS_NXT_DATA)
412 typedef struct
414 PSTR pNameTarget;
415 WORD wPriority;
416 WORD wWeight;
417 WORD wPort;
418 WORD Pad;
419 } DNS_SRV_DATAA, *PDNS_SRV_DATAA;
421 typedef struct
423 PWSTR pNameTarget;
424 WORD wPriority;
425 WORD wWeight;
426 WORD wPort;
427 WORD Pad;
428 } DNS_SRV_DATAW, *PDNS_SRV_DATAW;
430 DECL_WINELIB_TYPE_AW(DNS_SRV_DATA)
431 DECL_WINELIB_TYPE_AW(PDNS_SRV_DATA)
433 typedef struct
435 PSTR pNameAlgorithm;
436 PBYTE pAlgorithmPacket;
437 PBYTE pKey;
438 PBYTE pOtherData;
439 DWORD dwCreateTime;
440 DWORD dwExpireTime;
441 WORD wMode;
442 WORD wError;
443 WORD wKeyLength;
444 WORD wOtherLength;
445 UCHAR cAlgNameLength;
446 BOOL bPacketPointers;
447 } DNS_TKEY_DATAA, *PDNS_TKEY_DATAA;
449 typedef struct
451 PWSTR pNameAlgorithm;
452 PBYTE pAlgorithmPacket;
453 PBYTE pKey;
454 PBYTE pOtherData;
455 DWORD dwCreateTime;
456 DWORD dwExpireTime;
457 WORD wMode;
458 WORD wError;
459 WORD wKeyLength;
460 WORD wOtherLength;
461 UCHAR cAlgNameLength;
462 BOOL bPacketPointers;
463 } DNS_TKEY_DATAW, *PDNS_TKEY_DATAW;
465 DECL_WINELIB_TYPE_AW(DNS_TKEY_DATA)
466 DECL_WINELIB_TYPE_AW(PDNS_TKEY_DATA)
468 typedef struct
470 PSTR pNameAlgorithm;
471 PBYTE pAlgorithmPacket;
472 PBYTE pSignature;
473 PBYTE pOtherData;
474 LONGLONG i64CreateTime;
475 WORD wFudgeTime;
476 WORD wOriginalXid;
477 WORD wError;
478 WORD wSigLength;
479 WORD wOtherLength;
480 UCHAR cAlgNameLength;
481 BOOL bPacketPointers;
482 } DNS_TSIG_DATAA, *PDNS_TSIG_DATAA;
484 typedef struct
486 PWSTR pNameAlgorithm;
487 PBYTE pAlgorithmPacket;
488 PBYTE pSignature;
489 PBYTE pOtherData;
490 LONGLONG i64CreateTime;
491 WORD wFudgeTime;
492 WORD wOriginalXid;
493 WORD wError;
494 WORD wSigLength;
495 WORD wOtherLength;
496 UCHAR cAlgNameLength;
497 BOOL bPacketPointers;
498 } DNS_TSIG_DATAW, *PDNS_TSIG_DATAW;
500 typedef struct
502 DWORD dwMappingFlag;
503 DWORD dwLookupTimeout;
504 DWORD dwCacheTimeout;
505 DWORD cWinsServerCount;
506 IP4_ADDRESS WinsServers[1];
507 } DNS_WINS_DATA, *PDNS_WINS_DATA;
509 typedef struct
511 DWORD dwMappingFlag;
512 DWORD dwLookupTimeout;
513 DWORD dwCacheTimeout;
514 PSTR pNameResultDomain;
515 } DNS_WINSR_DATAA, *PDNS_WINSR_DATAA;
517 typedef struct
519 DWORD dwMappingFlag;
520 DWORD dwLookupTimeout;
521 DWORD dwCacheTimeout;
522 PWSTR pNameResultDomain;
523 } DNS_WINSR_DATAW, *PDNS_WINSR_DATAW;
525 DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA)
526 DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA)
528 typedef struct
530 WORD wDataLength;
531 WORD wPad;
532 BYTE Data[1];
534 DNS_OPT_DATA, *PDNS_OPT_DATA;
536 typedef struct _DnsRecordA
538 struct _DnsRecordA *pNext;
539 PSTR pName;
540 WORD wType;
541 WORD wDataLength;
542 union
544 DWORD DW;
545 DNS_RECORD_FLAGS S;
546 } Flags;
547 DWORD dwTtl;
548 DWORD dwReserved;
549 union
551 DNS_A_DATA A;
552 DNS_SOA_DATAA SOA, Soa;
553 DNS_PTR_DATAA PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
554 DNS_MINFO_DATAA MINFO, Minfo, RP, Rp;
555 DNS_MX_DATAA MX, Mx, AFSDB, Afsdb, RT, Rt;
556 DNS_TXT_DATAA HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
557 DNS_NULL_DATA Null;
558 DNS_WKS_DATA WKS, Wks;
559 DNS_AAAA_DATA AAAA;
560 DNS_KEY_DATA KEY, Key;
561 DNS_SIG_DATAA SIG, Sig;
562 DNS_ATMA_DATA ATMA, Atma;
563 DNS_NXT_DATAA NXT, Nxt;
564 DNS_SRV_DATAA SRV, Srv;
565 DNS_TKEY_DATAA TKEY, Tkey;
566 DNS_TSIG_DATAA TSIG, Tsig;
567 DNS_WINS_DATA WINS, Wins;
568 DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
569 DNS_OPT_DATA OPT, Opt;
570 } Data;
571 } DNS_RECORDA, *PDNS_RECORDA;
573 typedef struct _DnsRecordW
575 struct _DnsRecordW *pNext;
576 PWSTR pName;
577 WORD wType;
578 WORD wDataLength;
579 union
581 DWORD DW;
582 DNS_RECORD_FLAGS S;
583 } Flags;
584 DWORD dwTtl;
585 DWORD dwReserved;
586 union
588 DNS_A_DATA A;
589 DNS_SOA_DATAW SOA, Soa;
590 DNS_PTR_DATAW PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
591 DNS_MINFO_DATAW MINFO, Minfo, RP, Rp;
592 DNS_MX_DATAW MX, Mx, AFSDB, Afsdb, RT, Rt;
593 DNS_TXT_DATAW HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
594 DNS_NULL_DATA Null;
595 DNS_WKS_DATA WKS, Wks;
596 DNS_AAAA_DATA AAAA;
597 DNS_KEY_DATA KEY, Key;
598 DNS_SIG_DATAW SIG, Sig;
599 DNS_ATMA_DATA ATMA, Atma;
600 DNS_NXT_DATAW NXT, Nxt;
601 DNS_SRV_DATAW SRV, Srv;
602 DNS_TKEY_DATAW TKEY, Tkey;
603 DNS_TSIG_DATAW TSIG, Tsig;
604 DNS_WINS_DATA WINS, Wins;
605 DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
606 DNS_OPT_DATA OPT, Opt;
607 } Data;
608 } DNS_RECORDW, *PDNS_RECORDW;
610 #if defined(__WINESRC__) || defined(UNICODE)
611 typedef DNS_RECORDW DNS_RECORD;
612 typedef PDNS_RECORDW PDNS_RECORD;
613 #else
614 typedef DNS_RECORDA DNS_RECORD;
615 typedef PDNS_RECORDA PDNS_RECORD;
616 #endif
618 typedef struct _DnsRRSet
620 PDNS_RECORD pFirstRR;
621 PDNS_RECORD pLastRR;
622 } DNS_RRSET, *PDNS_RRSET;
624 #define DNS_RRSET_INIT( rrset ) \
626 PDNS_RRSET _prrset = &(rrset); \
627 _prrset->pFirstRR = NULL; \
628 _prrset->pLastRR = (PDNS_RECORD) &_prrset->pFirstRR; \
631 #define DNS_RRSET_ADD( rrset, pnewRR ) \
633 PDNS_RRSET _prrset = &(rrset); \
634 PDNS_RECORD _prrnew = (pnewRR); \
635 _prrset->pLastRR->pNext = _prrnew; \
636 _prrset->pLastRR = _prrnew; \
639 #define DNS_RRSET_TERMINATE( rrset ) \
641 PDNS_RRSET _prrset = &(rrset); \
642 _prrset->pLastRR->pNext = NULL; \
645 #define DNS_ADDR_MAX_SOCKADDR_LENGTH 32
647 #include <pshpack1.h>
649 typedef struct _DnsAddr
651 char MaxSa[DNS_ADDR_MAX_SOCKADDR_LENGTH];
652 union {
653 DWORD DnsAddrUserDword[8];
654 } Data;
655 } DNS_ADDR, *PDNS_ADDR;
657 typedef struct _DnsAddrArray
659 DWORD MaxCount;
660 DWORD AddrCount;
661 DWORD Tag;
662 WORD Family;
663 WORD WordReserved;
664 DWORD Flags;
665 DWORD MatchFlag;
666 DWORD Reserved1;
667 DWORD Reserved2;
668 DNS_ADDR AddrArray[1];
669 } DNS_ADDR_ARRAY, *PDNS_ADDR_ARRAY;
671 #include <poppack.h>
673 #define DNS_QUERY_RESULTS_VERSION1 0x1
675 typedef struct _DNS_QUERY_RESULT
677 ULONG Version;
678 DNS_STATUS QueryStatus;
679 ULONG64 QueryOptions;
680 DNS_RECORD *pQueryRecords;
681 void *Reserved;
682 } DNS_QUERY_RESULT, *PDNS_QUERY_RESULT;
684 typedef void WINAPI DNS_QUERY_COMPLETION_ROUTINE(void*,DNS_QUERY_RESULT*);
685 typedef DNS_QUERY_COMPLETION_ROUTINE *PDNS_QUERY_COMPLETION_ROUTINE;
687 #define DNS_QUERY_REQUEST_VERSION1 0x1
689 typedef struct _DNS_QUERY_REQUEST
691 ULONG Version;
692 const WCHAR *QueryName;
693 WORD QueryType;
694 ULONG64 QueryOptions;
695 PDNS_ADDR_ARRAY pDnsServerList;
696 ULONG InterfaceIndex;
697 PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback;
698 void *pQueryContext;
699 } DNS_QUERY_REQUEST, *PDNS_QUERY_REQUEST;
701 typedef struct _DNS_QUERY_CANCEL
703 char Reserved[32];
704 } DNS_QUERY_CANCEL, *PDNS_QUERY_CANCEL;
706 typedef struct _DNS_CACHE_ENTRY
708 struct _DNS_CACHE_ENTRY* Next;
709 const WCHAR *Name;
710 WORD Type;
711 WORD DataLength;
712 ULONG Flags;
713 } DNS_CACHE_ENTRY, *PDNS_CACHE_ENTRY;
715 DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE);
716 DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE);
717 #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_)
718 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_W(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDW*);
719 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_UTF8(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDA*);
720 VOID WINAPI DnsFree(PVOID,DNS_FREE_TYPE);
721 DNS_STATUS WINAPI DnsModifyRecordsInSet_A(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
722 DNS_STATUS WINAPI DnsModifyRecordsInSet_W(PDNS_RECORDW,PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
723 DNS_STATUS WINAPI DnsModifyRecordsInSet_UTF8(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
724 #define DnsModifyRecordsInSet WINELIB_NAME_AW(DnsModifyRecordsInSet_)
725 BOOL WINAPI DnsNameCompare_A(PCSTR,PCSTR);
726 BOOL WINAPI DnsNameCompare_W(PCWSTR,PCWSTR);
727 #define DnsNameCompare WINELIB_NAME_AW(DnsNameCompare_)
728 DNS_STATUS WINAPI DnsQuery_A(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
729 DNS_STATUS WINAPI DnsQuery_W(PCWSTR,WORD,DWORD,PVOID,PDNS_RECORDW*,PVOID*);
730 DNS_STATUS WINAPI DnsQuery_UTF8(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
731 #define DnsQuery WINELIB_NAME_AW(DnsQuery_)
732 DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST*,DNS_QUERY_RESULT*,DNS_QUERY_CANCEL*);
733 DNS_STATUS WINAPI DnsCancelQuery(DNS_QUERY_CANCEL*);
734 DNS_STATUS WINAPI DnsQueryConfig(DNS_CONFIG_TYPE,DWORD,PCWSTR,PVOID,PVOID,PDWORD);
735 BOOL WINAPI DnsRecordCompare(PDNS_RECORD,PDNS_RECORD);
736 PDNS_RECORD WINAPI DnsRecordCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
737 VOID WINAPI DnsRecordListFree(PDNS_RECORD,DNS_FREE_TYPE);
738 BOOL WINAPI DnsRecordSetCompare(PDNS_RECORD,PDNS_RECORD,PDNS_RECORD*,PDNS_RECORD*);
739 PDNS_RECORD WINAPI DnsRecordSetCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
740 PDNS_RECORD WINAPI DnsRecordSetDetach(PDNS_RECORD);
741 void WINAPI DnsReleaseContextHandle(HANDLE);
742 DNS_STATUS WINAPI DnsReplaceRecordSetA(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
743 DNS_STATUS WINAPI DnsReplaceRecordSetW(PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
744 DNS_STATUS WINAPI DnsReplaceRecordSetUTF8(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
745 #define DnsReplaceRecordSet WINELIB_NAME_AW(DnsReplaceRecordSet)
746 DNS_STATUS WINAPI DnsValidateName_A(PCSTR,DNS_NAME_FORMAT);
747 DNS_STATUS WINAPI DnsValidateName_W(PCWSTR, DNS_NAME_FORMAT);
748 DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT);
749 #define DnsValidateName WINELIB_NAME_AW(DnsValidateName_)
750 BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL);
751 BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL);
752 BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*);
754 #ifdef __cplusplus
756 #endif
758 #endif