wined3d: Support CPU clear of float16 formats.
[wine.git] / include / windns.h
blobb0b14df1b4ff069782c84d24dde5db49bd725e68
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 #define INLINE_WORD_FLIP(out, in) { WORD _in = (in); (out) = (_in << 8) | (_in >> 8); }
112 #define INLINE_HTONS(out, in) INLINE_WORD_FLIP(out, in)
113 #define INLINE_NTOHS(out, in) INLINE_WORD_FLIP(out, in)
115 #define DNS_BYTE_FLIP_HEADER_COUNTS(header) { \
116 DNS_HEADER *_head = (header); \
117 INLINE_HTONS( _head->Xid, _head->Xid ); \
118 INLINE_HTONS( _head->QuestionCount, _head->QuestionCount ); \
119 INLINE_HTONS( _head->AnswerCount, _head->AnswerCount ); \
120 INLINE_HTONS( _head->NameServerCount, _head->NameServerCount ); \
121 INLINE_HTONS( _head->AdditionalCount, _head->AdditionalCount ); }
123 typedef enum _DNS_NAME_FORMAT
125 DnsNameDomain,
126 DnsNameDomainLabel,
127 DnsNameHostnameFull,
128 DnsNameHostnameLabel,
129 DnsNameWildcard,
130 DnsNameSrvRecord
131 } DNS_NAME_FORMAT;
133 typedef enum _DNS_FREE_TYPE
135 DnsFreeFlat,
136 DnsFreeRecordList,
137 DnsFreeParsedMessageFields
138 } DNS_FREE_TYPE;
140 typedef enum _DNS_CHARSET
142 DnsCharSetUnknown,
143 DnsCharSetUnicode,
144 DnsCharSetUtf8,
145 DnsCharSetAnsi
146 } DNS_CHARSET;
148 typedef enum _DNS_CONFIG_TYPE
150 DnsConfigPrimaryDomainName_W,
151 DnsConfigPrimaryDomainName_A,
152 DnsConfigPrimaryDomainName_UTF8,
153 DnsConfigAdapterDomainName_W,
154 DnsConfigAdapterDomainName_A,
155 DnsConfigAdapterDomainName_UTF8,
156 DnsConfigDnsServerList,
157 DnsConfigSearchList,
158 DnsConfigAdapterInfo,
159 DnsConfigPrimaryHostNameRegistrationEnabled,
160 DnsConfigAdapterHostNameRegistrationEnabled,
161 DnsConfigAddressRegistrationMaxCount,
162 DnsConfigHostName_W,
163 DnsConfigHostName_A,
164 DnsConfigHostName_UTF8,
165 DnsConfigFullHostName_W,
166 DnsConfigFullHostName_A,
167 DnsConfigFullHostName_UTF8,
169 /* These are undocumented and return a DNS_ADDR_ARRAY */
170 DnsConfigDnsServersUnspec = 4144,
171 DnsConfigDnsServersIpv4,
172 DnsConfigDnsServersIpv6
173 } DNS_CONFIG_TYPE;
175 typedef enum _DnsSection
177 DnsSectionQuestion,
178 DnsSectionAnswer,
179 DnsSectionAuthority,
180 DnsSectionAddtional /* Not a typo, as per Microsoft's headers */
181 } DNS_SECTION;
183 typedef LONG DNS_STATUS, *PDNS_STATUS;
184 typedef DWORD IP4_ADDRESS, *PIP4_ADDRESS;
186 typedef struct
188 DWORD IP6Dword[4];
189 } IP6_ADDRESS, *PIP6_ADDRESS, DNS_IP6_ADDRESS, *PDNS_IP6_ADDRESS;
191 #define SIZEOF_IP4_ADDRESS 4
192 #define IP4_ADDRESS_STRING_LENGTH 16
193 #define IP6_ADDRESS_STRING_LENGTH 65
194 #define DNS_ADDRESS_STRING_LENGTH IP6_ADDRESS_STRING_LENGTH
195 #define IP4_ADDRESS_STRING_BUFFER_LENGTH IP4_ADDRESS_STRING_LENGTH
196 #define IP6_ADDRESS_STRING_BUFFER_LENGTH IP6_ADDRESS_STRING_LENGTH
198 #define DNS_MAX_NAME_LENGTH 255
199 #define DNS_MAX_LABEL_LENGTH 63
200 #define DNS_MAX_NAME_BUFFER_LENGTH (DNS_MAX_NAME_LENGTH + 1)
201 #define DNS_MAX_LABEL_BUFFER_LENGTH (DNS_MAX_LABEL_LENGTH + 1)
203 typedef struct _IP4_ARRAY
205 DWORD AddrCount;
206 IP4_ADDRESS AddrArray[1];
207 } IP4_ARRAY, *PIP4_ARRAY;
209 #define DNS_OPCODE_QUERY 0
210 #define DNS_OPCODE_IQUERY 1
211 #define DNS_OPCODE_SERVER_STATUS 2
212 #define DNS_OPCODE_UNKNOWN 3
213 #define DNS_OPCODE_NOTIFY 4
214 #define DNS_OPCODE_UPDATE 5
216 #define DNS_RCODE_NOERROR 0
217 #define DNS_RCODE_FORMERR 1
218 #define DNS_RCODE_SERVFAIL 2
219 #define DNS_RCODE_NXDOMAIN 3
220 #define DNS_RCODE_NOTIMPL 4
221 #define DNS_RCODE_REFUSED 5
222 #define DNS_RCODE_YXDOMAIN 6
223 #define DNS_RCODE_YXRRSET 7
224 #define DNS_RCODE_NXRRSET 8
225 #define DNS_RCODE_NOTAUTH 9
226 #define DNS_RCODE_NOTZONE 10
227 #define DNS_RCODE_MAX 15
228 #define DNS_RCODE_BADVERS 16
229 #define DNS_RCODE_BADSIG 16
230 #define DNS_RCODE_BADKEY 17
231 #define DNS_RCODE_BADTIME 18
233 #define DNS_RCODE_NO_ERROR DNS_RCODE_NOERROR
234 #define DNS_RCODE_FORMAT_ERROR DNS_RCODE_FORMERR
235 #define DNS_RCODE_SERVER_FAILURE DNS_RCODE_SERVFAIL
236 #define DNS_RCODE_NAME_ERROR DNS_RCODE_NXDOMAIN
237 #define DNS_RCODE_NOT_IMPLEMENTED DNS_RCODE_NOTIMPL
239 #include <pshpack1.h>
240 typedef struct _DNS_HEADER
242 WORD Xid;
243 BYTE RecursionDesired:1;
244 BYTE Truncation:1;
245 BYTE Authoritative:1;
246 BYTE Opcode:4;
247 BYTE IsResponse:1;
248 BYTE ResponseCode:4;
249 BYTE CheckingDisabled:1;
250 BYTE AuthenticatedData:1;
251 BYTE Reserved:1;
252 BYTE RecursionAvailable:1;
253 WORD QuestionCount;
254 WORD AnswerCount;
255 WORD NameServerCount;
256 WORD AdditionalCount;
257 } DNS_HEADER, *PDNS_HEADER;
258 #include <poppack.h>
260 typedef struct _DNS_MESSAGE_BUFFER
262 DNS_HEADER MessageHead;
263 CHAR MessageBody[1];
264 } DNS_MESSAGE_BUFFER, *PDNS_MESSAGE_BUFFER;
266 typedef struct
268 IP4_ADDRESS IpAddress;
269 } DNS_A_DATA, *PDNS_A_DATA;
271 typedef struct _DnsRecordFlags
273 DWORD Section :2;
274 DWORD Delete :1;
275 DWORD CharSet :2;
276 DWORD Unused :3;
277 DWORD Reserved :24;
278 } DNS_RECORD_FLAGS;
280 typedef struct
282 PSTR pNamePrimaryServer;
283 PSTR pNameAdministrator;
284 DWORD dwSerialNo;
285 DWORD dwRefresh;
286 DWORD dwRetry;
287 DWORD dwExpire;
288 DWORD dwDefaultTtl;
289 } DNS_SOA_DATAA, *PDNS_SOA_DATAA;
291 typedef struct
293 PWSTR pNamePrimaryServer;
294 PWSTR pNameAdministrator;
295 DWORD dwSerialNo;
296 DWORD dwRefresh;
297 DWORD dwRetry;
298 DWORD dwExpire;
299 DWORD dwDefaultTtl;
300 } DNS_SOA_DATAW, *PDNS_SOA_DATAW;
302 DECL_WINELIB_TYPE_AW(DNS_SOA_DATA)
303 DECL_WINELIB_TYPE_AW(PDNS_SOA_DATA)
305 typedef struct
307 PSTR pNameHost;
308 } DNS_PTR_DATAA, *PDNS_PTR_DATAA;
310 typedef struct
312 PWSTR pNameHost;
313 } DNS_PTR_DATAW, *PDNS_PTR_DATAW;
315 DECL_WINELIB_TYPE_AW(DNS_PTR_DATA)
316 DECL_WINELIB_TYPE_AW(PDNS_PTR_DATA)
318 typedef struct
320 PSTR pNameMailbox;
321 PSTR pNameErrorsMailbox;
322 } DNS_MINFO_DATAA, *PDNS_MINFO_DATAA;
324 typedef struct
326 PWSTR pNameMailbox;
327 PWSTR pNameErrorsMailbox;
328 } DNS_MINFO_DATAW, *PDNS_MINFO_DATAW;
330 DECL_WINELIB_TYPE_AW(DNS_MINFO_DATA)
331 DECL_WINELIB_TYPE_AW(PDNS_MINFO_DATA)
333 typedef struct
335 PSTR pNameExchange;
336 WORD wPreference;
337 WORD Pad;
338 } DNS_MX_DATAA, *PDNS_MX_DATAA;
340 typedef struct
342 PWSTR pNameExchange;
343 WORD wPreference;
344 WORD Pad;
345 } DNS_MX_DATAW, *PDNS_MX_DATAW;
347 DECL_WINELIB_TYPE_AW(DNS_MX_DATA)
348 DECL_WINELIB_TYPE_AW(PDNS_MX_DATA)
350 typedef struct
352 DWORD dwStringCount;
353 PSTR pStringArray[1];
354 } DNS_TXT_DATAA, *PDNS_TXT_DATAA;
356 typedef struct
358 DWORD dwStringCount;
359 PWSTR pStringArray[1];
360 } DNS_TXT_DATAW, *PDNS_TXT_DATAW;
362 DECL_WINELIB_TYPE_AW(DNS_TXT_DATA)
363 DECL_WINELIB_TYPE_AW(PDNS_TXT_DATA)
365 typedef struct
367 DWORD dwByteCount;
368 BYTE Data[1];
369 } DNS_NULL_DATA, *PDNS_NULL_DATA;
371 typedef struct
373 IP4_ADDRESS IpAddress;
374 UCHAR chProtocol;
375 BYTE BitMask[1];
376 } DNS_WKS_DATA, *PDNS_WKS_DATA;
378 typedef struct
380 DNS_IP6_ADDRESS Ip6Address;
381 } DNS_AAAA_DATA, *PDNS_AAAA_DATA;
383 typedef struct
385 WORD wFlags;
386 BYTE chProtocol;
387 BYTE chAlgorithm;
388 WORD wKeyLength;
389 WORD wPad;
390 BYTE Key[1];
391 } DNS_KEY_DATA, *PDNS_KEY_DATA;
393 typedef struct
395 WORD wVersion;
396 WORD wSize;
397 WORD wHorPrec;
398 WORD wVerPrec;
399 DWORD dwLatitude;
400 DWORD dwLongitude;
401 DWORD dwAltitude;
402 } DNS_LOC_DATA, *PDNS_LOC_DATA;
404 typedef struct
406 WORD wTypeCovered;
407 BYTE chAlgorithm;
408 BYTE chLabelCount;
409 DWORD dwOriginalTtl;
410 DWORD dwExpiration;
411 DWORD dwTimeSigned;
412 WORD wKeyTag;
413 WORD wSignatureLength;
414 PSTR pNameSigner;
415 BYTE Signature[1];
416 } DNS_SIG_DATAA, *PDNS_SIG_DATAA;
418 typedef struct
420 WORD wTypeCovered;
421 BYTE chAlgorithm;
422 BYTE chLabelCount;
423 DWORD dwOriginalTtl;
424 DWORD dwExpiration;
425 DWORD dwTimeSigned;
426 WORD wKeyTag;
427 WORD wSignatureLength;
428 PWSTR pNameSigner;
429 BYTE Signature[1];
430 } DNS_SIG_DATAW, *PDNS_SIG_DATAW;
432 DECL_WINELIB_TYPE_AW(DNS_SIG_DATA)
433 DECL_WINELIB_TYPE_AW(PDNS_SIG_DATA)
435 #define DNS_ATMA_MAX_ADDR_LENGTH 20
437 typedef struct
439 BYTE AddressType;
440 BYTE Address[DNS_ATMA_MAX_ADDR_LENGTH];
441 } DNS_ATMA_DATA, *PDNS_ATMA_DATA;
443 typedef struct
445 PSTR pNameNext;
446 WORD wNumTypes;
447 WORD wTypes[1];
448 } DNS_NXT_DATAA, *PDNS_NXT_DATAA;
450 typedef struct
452 PWSTR pNameNext;
453 WORD wNumTypes;
454 WORD wTypes[1];
455 } DNS_NXT_DATAW, *PDNS_NXT_DATAW;
457 DECL_WINELIB_TYPE_AW(DNS_NXT_DATA)
458 DECL_WINELIB_TYPE_AW(PDNS_NXT_DATA)
460 typedef struct
462 PSTR pNameTarget;
463 WORD wPriority;
464 WORD wWeight;
465 WORD wPort;
466 WORD Pad;
467 } DNS_SRV_DATAA, *PDNS_SRV_DATAA;
469 typedef struct
471 PWSTR pNameTarget;
472 WORD wPriority;
473 WORD wWeight;
474 WORD wPort;
475 WORD Pad;
476 } DNS_SRV_DATAW, *PDNS_SRV_DATAW;
478 DECL_WINELIB_TYPE_AW(DNS_SRV_DATA)
479 DECL_WINELIB_TYPE_AW(PDNS_SRV_DATA)
481 typedef struct
483 PSTR pNameAlgorithm;
484 PBYTE pAlgorithmPacket;
485 PBYTE pKey;
486 PBYTE pOtherData;
487 DWORD dwCreateTime;
488 DWORD dwExpireTime;
489 WORD wMode;
490 WORD wError;
491 WORD wKeyLength;
492 WORD wOtherLength;
493 UCHAR cAlgNameLength;
494 BOOL bPacketPointers;
495 } DNS_TKEY_DATAA, *PDNS_TKEY_DATAA;
497 typedef struct
499 PWSTR pNameAlgorithm;
500 PBYTE pAlgorithmPacket;
501 PBYTE pKey;
502 PBYTE pOtherData;
503 DWORD dwCreateTime;
504 DWORD dwExpireTime;
505 WORD wMode;
506 WORD wError;
507 WORD wKeyLength;
508 WORD wOtherLength;
509 UCHAR cAlgNameLength;
510 BOOL bPacketPointers;
511 } DNS_TKEY_DATAW, *PDNS_TKEY_DATAW;
513 DECL_WINELIB_TYPE_AW(DNS_TKEY_DATA)
514 DECL_WINELIB_TYPE_AW(PDNS_TKEY_DATA)
516 typedef struct
518 PSTR pNameAlgorithm;
519 PBYTE pAlgorithmPacket;
520 PBYTE pSignature;
521 PBYTE pOtherData;
522 LONGLONG i64CreateTime;
523 WORD wFudgeTime;
524 WORD wOriginalXid;
525 WORD wError;
526 WORD wSigLength;
527 WORD wOtherLength;
528 UCHAR cAlgNameLength;
529 BOOL bPacketPointers;
530 } DNS_TSIG_DATAA, *PDNS_TSIG_DATAA;
532 typedef struct
534 PWSTR pNameAlgorithm;
535 PBYTE pAlgorithmPacket;
536 PBYTE pSignature;
537 PBYTE pOtherData;
538 LONGLONG i64CreateTime;
539 WORD wFudgeTime;
540 WORD wOriginalXid;
541 WORD wError;
542 WORD wSigLength;
543 WORD wOtherLength;
544 UCHAR cAlgNameLength;
545 BOOL bPacketPointers;
546 } DNS_TSIG_DATAW, *PDNS_TSIG_DATAW;
548 typedef struct
550 DWORD dwMappingFlag;
551 DWORD dwLookupTimeout;
552 DWORD dwCacheTimeout;
553 DWORD cWinsServerCount;
554 IP4_ADDRESS WinsServers[1];
555 } DNS_WINS_DATA, *PDNS_WINS_DATA;
557 typedef struct
559 DWORD dwMappingFlag;
560 DWORD dwLookupTimeout;
561 DWORD dwCacheTimeout;
562 PSTR pNameResultDomain;
563 } DNS_WINSR_DATAA, *PDNS_WINSR_DATAA;
565 typedef struct
567 DWORD dwMappingFlag;
568 DWORD dwLookupTimeout;
569 DWORD dwCacheTimeout;
570 PWSTR pNameResultDomain;
571 } DNS_WINSR_DATAW, *PDNS_WINSR_DATAW;
573 DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA)
574 DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA)
576 typedef struct
578 WORD wDataLength;
579 WORD wPad;
580 BYTE Data[1];
582 DNS_OPT_DATA, *PDNS_OPT_DATA;
584 typedef struct _DnsRecordA
586 struct _DnsRecordA *pNext;
587 PSTR pName;
588 WORD wType;
589 WORD wDataLength;
590 union
592 DWORD DW;
593 DNS_RECORD_FLAGS S;
594 } Flags;
595 DWORD dwTtl;
596 DWORD dwReserved;
597 union
599 DNS_A_DATA A;
600 DNS_SOA_DATAA SOA, Soa;
601 DNS_PTR_DATAA PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
602 DNS_MINFO_DATAA MINFO, Minfo, RP, Rp;
603 DNS_MX_DATAA MX, Mx, AFSDB, Afsdb, RT, Rt;
604 DNS_TXT_DATAA HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
605 DNS_NULL_DATA Null;
606 DNS_WKS_DATA WKS, Wks;
607 DNS_AAAA_DATA AAAA;
608 DNS_KEY_DATA KEY, Key;
609 DNS_SIG_DATAA SIG, Sig;
610 DNS_ATMA_DATA ATMA, Atma;
611 DNS_NXT_DATAA NXT, Nxt;
612 DNS_SRV_DATAA SRV, Srv;
613 DNS_TKEY_DATAA TKEY, Tkey;
614 DNS_TSIG_DATAA TSIG, Tsig;
615 DNS_WINS_DATA WINS, Wins;
616 DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
617 DNS_OPT_DATA OPT, Opt;
618 } Data;
619 } DNS_RECORDA, *PDNS_RECORDA;
621 typedef struct _DnsRecordW
623 struct _DnsRecordW *pNext;
624 PWSTR pName;
625 WORD wType;
626 WORD wDataLength;
627 union
629 DWORD DW;
630 DNS_RECORD_FLAGS S;
631 } Flags;
632 DWORD dwTtl;
633 DWORD dwReserved;
634 union
636 DNS_A_DATA A;
637 DNS_SOA_DATAW SOA, Soa;
638 DNS_PTR_DATAW PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
639 DNS_MINFO_DATAW MINFO, Minfo, RP, Rp;
640 DNS_MX_DATAW MX, Mx, AFSDB, Afsdb, RT, Rt;
641 DNS_TXT_DATAW HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
642 DNS_NULL_DATA Null;
643 DNS_WKS_DATA WKS, Wks;
644 DNS_AAAA_DATA AAAA;
645 DNS_KEY_DATA KEY, Key;
646 DNS_SIG_DATAW SIG, Sig;
647 DNS_ATMA_DATA ATMA, Atma;
648 DNS_NXT_DATAW NXT, Nxt;
649 DNS_SRV_DATAW SRV, Srv;
650 DNS_TKEY_DATAW TKEY, Tkey;
651 DNS_TSIG_DATAW TSIG, Tsig;
652 DNS_WINS_DATA WINS, Wins;
653 DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
654 DNS_OPT_DATA OPT, Opt;
655 } Data;
656 } DNS_RECORDW, *PDNS_RECORDW;
658 #if defined(__WINESRC__) || defined(UNICODE)
659 typedef DNS_RECORDW DNS_RECORD;
660 typedef PDNS_RECORDW PDNS_RECORD;
661 #else
662 typedef DNS_RECORDA DNS_RECORD;
663 typedef PDNS_RECORDA PDNS_RECORD;
664 #endif
666 typedef struct _DnsRRSet
668 PDNS_RECORD pFirstRR;
669 PDNS_RECORD pLastRR;
670 } DNS_RRSET, *PDNS_RRSET;
672 #define DNS_RRSET_INIT( rrset ) \
674 PDNS_RRSET _prrset = &(rrset); \
675 _prrset->pFirstRR = NULL; \
676 _prrset->pLastRR = (PDNS_RECORD) &_prrset->pFirstRR; \
679 #define DNS_RRSET_ADD( rrset, pnewRR ) \
681 PDNS_RRSET _prrset = &(rrset); \
682 PDNS_RECORD _prrnew = (pnewRR); \
683 _prrset->pLastRR->pNext = _prrnew; \
684 _prrset->pLastRR = _prrnew; \
687 #define DNS_RRSET_TERMINATE( rrset ) \
689 PDNS_RRSET _prrset = &(rrset); \
690 _prrset->pLastRR->pNext = NULL; \
693 #define DNS_ADDR_MAX_SOCKADDR_LENGTH 32
695 #include <pshpack1.h>
697 typedef struct _DnsAddr
699 char MaxSa[DNS_ADDR_MAX_SOCKADDR_LENGTH];
700 union {
701 DWORD DnsAddrUserDword[8];
702 } Data;
703 } DNS_ADDR, *PDNS_ADDR;
705 typedef struct _DnsAddrArray
707 DWORD MaxCount;
708 DWORD AddrCount;
709 DWORD Tag;
710 WORD Family;
711 WORD WordReserved;
712 DWORD Flags;
713 DWORD MatchFlag;
714 DWORD Reserved1;
715 DWORD Reserved2;
716 DNS_ADDR AddrArray[1];
717 } DNS_ADDR_ARRAY, *PDNS_ADDR_ARRAY;
719 #include <poppack.h>
721 #define DNS_QUERY_RESULTS_VERSION1 0x1
723 typedef struct _DNS_QUERY_RESULT
725 ULONG Version;
726 DNS_STATUS QueryStatus;
727 ULONG64 QueryOptions;
728 DNS_RECORD *pQueryRecords;
729 void *Reserved;
730 } DNS_QUERY_RESULT, *PDNS_QUERY_RESULT;
732 typedef void WINAPI DNS_QUERY_COMPLETION_ROUTINE(void*,DNS_QUERY_RESULT*);
733 typedef DNS_QUERY_COMPLETION_ROUTINE *PDNS_QUERY_COMPLETION_ROUTINE;
735 #define DNS_QUERY_REQUEST_VERSION1 0x1
737 typedef struct _DNS_QUERY_REQUEST
739 ULONG Version;
740 const WCHAR *QueryName;
741 WORD QueryType;
742 ULONG64 QueryOptions;
743 PDNS_ADDR_ARRAY pDnsServerList;
744 ULONG InterfaceIndex;
745 PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback;
746 void *pQueryContext;
747 } DNS_QUERY_REQUEST, *PDNS_QUERY_REQUEST;
749 typedef struct _DNS_QUERY_CANCEL
751 char Reserved[32];
752 } DNS_QUERY_CANCEL, *PDNS_QUERY_CANCEL;
754 typedef struct _DNS_CACHE_ENTRY
756 struct _DNS_CACHE_ENTRY* Next;
757 const WCHAR *Name;
758 WORD Type;
759 WORD DataLength;
760 ULONG Flags;
761 } DNS_CACHE_ENTRY, *PDNS_CACHE_ENTRY;
763 DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE);
764 DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE);
765 #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_)
766 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_W(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDW*);
767 DNS_STATUS WINAPI DnsExtractRecordsFromMessage_UTF8(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDA*);
768 VOID WINAPI DnsFree(PVOID,DNS_FREE_TYPE);
769 DNS_STATUS WINAPI DnsModifyRecordsInSet_A(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
770 DNS_STATUS WINAPI DnsModifyRecordsInSet_W(PDNS_RECORDW,PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
771 DNS_STATUS WINAPI DnsModifyRecordsInSet_UTF8(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
772 #define DnsModifyRecordsInSet WINELIB_NAME_AW(DnsModifyRecordsInSet_)
773 BOOL WINAPI DnsNameCompare_A(PCSTR,PCSTR);
774 BOOL WINAPI DnsNameCompare_W(PCWSTR,PCWSTR);
775 #define DnsNameCompare WINELIB_NAME_AW(DnsNameCompare_)
776 DNS_STATUS WINAPI DnsQuery_A(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
777 DNS_STATUS WINAPI DnsQuery_W(PCWSTR,WORD,DWORD,PVOID,PDNS_RECORDW*,PVOID*);
778 DNS_STATUS WINAPI DnsQuery_UTF8(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
779 #define DnsQuery WINELIB_NAME_AW(DnsQuery_)
780 DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST*,DNS_QUERY_RESULT*,DNS_QUERY_CANCEL*);
781 DNS_STATUS WINAPI DnsCancelQuery(DNS_QUERY_CANCEL*);
782 DNS_STATUS WINAPI DnsQueryConfig(DNS_CONFIG_TYPE,DWORD,PCWSTR,PVOID,PVOID,PDWORD);
783 BOOL WINAPI DnsRecordCompare(PDNS_RECORD,PDNS_RECORD);
784 PDNS_RECORD WINAPI DnsRecordCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
785 VOID WINAPI DnsRecordListFree(PDNS_RECORD,DNS_FREE_TYPE);
786 BOOL WINAPI DnsRecordSetCompare(PDNS_RECORD,PDNS_RECORD,PDNS_RECORD*,PDNS_RECORD*);
787 PDNS_RECORD WINAPI DnsRecordSetCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
788 PDNS_RECORD WINAPI DnsRecordSetDetach(PDNS_RECORD);
789 void WINAPI DnsReleaseContextHandle(HANDLE);
790 DNS_STATUS WINAPI DnsReplaceRecordSetA(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
791 DNS_STATUS WINAPI DnsReplaceRecordSetW(PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
792 DNS_STATUS WINAPI DnsReplaceRecordSetUTF8(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
793 #define DnsReplaceRecordSet WINELIB_NAME_AW(DnsReplaceRecordSet)
794 DNS_STATUS WINAPI DnsValidateName_A(PCSTR,DNS_NAME_FORMAT);
795 DNS_STATUS WINAPI DnsValidateName_W(PCWSTR, DNS_NAME_FORMAT);
796 DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT);
797 #define DnsValidateName WINELIB_NAME_AW(DnsValidateName_)
798 BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL);
799 BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL);
800 BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*);
802 #ifdef __cplusplus
804 #endif
806 #endif