9509241a49b4d42a952eb991cc5b24713db183c3
[reactos.git] / reactos / sdk / include / psdk / windns.h
1 #ifndef _WINDNS_INCLUDED_
2 #define _WINDNS_INCLUDED_
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #define DNS_QUERY_STANDARD 0x0
9 #define DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE 0x1
10 #define DNS_QUERY_USE_TCP_ONLY 0x2
11 #define DNS_QUERY_NO_RECURSION 0x4
12 #define DNS_QUERY_BYPASS_CACHE 0x8
13 #define DNS_QUERY_NO_WIRE_QUERY 0x10
14 #define DNS_QUERY_NO_LOCAL_NAME 0x20
15 #define DNS_QUERY_NO_HOSTS_FILE 0x40
16 #define DNS_QUERY_NO_NETBT 0x80
17 #define DNS_QUERY_TREAT_AS_FQDN 0x1000
18 #define DNS_QUERY_WIRE_ONLY 0x100
19 #define DNS_QUERY_RETURN_MESSAGE 0x200
20 #define DNS_QUERY_DONT_RESET_TTL_VALUES 0x100000
21 #define DNS_QUERY_RESERVED 0xff000000
22
23 #define DNS_UPDATE_SECURITY_USE_DEFAULT 0x0
24 #define DNS_UPDATE_SECURITY_OFF 0x10
25 #define DNS_UPDATE_SECURITY_ON 0x20
26 #define DNS_UPDATE_SECURITY_ONLY 0x100
27 #define DNS_UPDATE_CACHE_SECURITY_CONTEXT 0x200
28 #define DNS_UPDATE_TEST_USE_LOCAL_SYS_ACCT 0x400
29 #define DNS_UPDATE_FORCE_SECURITY_NEGO 0x800
30 #define DNS_UPDATE_RESERVED 0xffff0000
31
32 #define DNS_CONFIG_FLAG_ALLOC TRUE
33
34 #ifndef RC_INVOKE
35
36 typedef DWORD IP4_ADDRESS;
37
38 typedef _Return_type_success_(return == 0) DWORD DNS_STATUS;
39
40 #define DNS_TYPE_ZERO 0x0000
41 #define DNS_TYPE_A 0x0001
42 #define DNS_TYPE_NS 0x0002
43 #define DNS_TYPE_MD 0x0003
44 #define DNS_TYPE_MF 0x0004
45 #define DNS_TYPE_CNAME 0x0005
46 #define DNS_TYPE_SOA 0x0006
47 #define DNS_TYPE_MB 0x0007
48 #define DNS_TYPE_MG 0x0008
49 #define DNS_TYPE_MR 0x0009
50 #define DNS_TYPE_NULL 0x000a
51 #define DNS_TYPE_WKS 0x000b
52 #define DNS_TYPE_PTR 0x000c
53 #define DNS_TYPE_HINFO 0x000d
54 #define DNS_TYPE_MINFO 0x000e
55 #define DNS_TYPE_MX 0x000f
56 #define DNS_TYPE_TEXT 0x0010
57 #define DNS_TYPE_RP 0x0011
58 #define DNS_TYPE_AFSDB 0x0012
59 #define DNS_TYPE_X25 0x0013
60 #define DNS_TYPE_ISDN 0x0014
61 #define DNS_TYPE_RT 0x0015
62 #define DNS_TYPE_NSAP 0x0016
63 #define DNS_TYPE_NSAPPTR 0x0017
64 #define DNS_TYPE_SIG 0x0018
65 #define DNS_TYPE_KEY 0x0019
66 #define DNS_TYPE_PX 0x001a
67 #define DNS_TYPE_GPOS 0x001b
68 #define DNS_TYPE_AAAA 0x001c
69 #define DNS_TYPE_LOC 0x001d
70 #define DNS_TYPE_NXT 0x001e
71 #define DNS_TYPE_EID 0x001f
72 #define DNS_TYPE_NIMLOC 0x0020
73 #define DNS_TYPE_SRV 0x0021
74 #define DNS_TYPE_ATMA 0x0022
75 #define DNS_TYPE_NAPTR 0x0023
76 #define DNS_TYPE_KX 0x0024
77 #define DNS_TYPE_CERT 0x0025
78 #define DNS_TYPE_A6 0x0026
79 #define DNS_TYPE_DNAME 0x0027
80 #define DNS_TYPE_SINK 0x0028
81 #define DNS_TYPE_OPT 0x0029
82 #define DNS_TYPE_UINFO 0x0064
83 #define DNS_TYPE_UID 0x0065
84 #define DNS_TYPE_GID 0x0066
85 #define DNS_TYPE_UNSPEC 0x0067
86 #define DNS_TYPE_ADDRS 0x00f8
87 #define DNS_TYPE_TKEY 0x00f9
88 #define DNS_TYPE_TSIG 0x00fa
89 #define DNS_TYPE_IXFR 0x00fb
90 #define DNS_TYPE_AXFR 0x00fc
91 #define DNS_TYPE_MAILB 0x00fd
92 #define DNS_TYPE_MAILA 0x00fe
93 #define DNS_TYPE_ALL 0x00ff
94 #define DNS_TYPE_ANY 0x00ff
95
96 #define DNS_TYPE_WINS 0xff01
97 #define DNS_TYPE_WINSR 0xff02
98 #define DNS_TYPE_NBSTAT (DNS_TYPE_WINSR)
99
100 #define DNSREC_QUESTION 0
101 #define DNSREC_ANSWER 1
102 #define DNSREC_AUTHORITY 2
103 #define DNSREC_ADDITIONAL 3
104
105 #define DNS_ATMA_MAX_ADDR_LENGTH 20
106
107 #define DNS_ADDR_MAX_SOCKADDR_LENGTH 32
108
109 typedef enum _DNS_CHARSET {
110 DnsCharSetUnknown,
111 DnsCharSetUnicode,
112 DnsCharSetUtf8,
113 DnsCharSetAnsi
114 } DNS_CHARSET;
115
116 typedef enum {
117 DnsConfigPrimaryDomainName_W,
118 DnsConfigPrimaryDomainName_A,
119 DnsConfigPrimaryDomainName_UTF8,
120 DnsConfigAdapterDomainName_W,
121 DnsConfigAdapterDomainName_A,
122 DnsConfigAdapterDomainName_UTF8,
123 DnsConfigDnsServerList,
124 DnsConfigSearchList,
125 DnsConfigAdapterInfo,
126 DnsConfigPrimaryHostNameRegistrationEnabled,
127 DnsConfigAdapterHostNameRegistrationEnabled,
128 DnsConfigAddressRegistrationMaxCount,
129 DnsConfigHostName_W,
130 DnsConfigHostName_A,
131 DnsConfigHostName_UTF8,
132 DnsConfigFullHostName_W,
133 DnsConfigFullHostName_A,
134 DnsConfigFullHostName_UTF8
135 } DNS_CONFIG_TYPE;
136
137 typedef enum {
138 DnsFreeFlat = 0,
139 DnsFreeRecordList,
140 DnsFreeParsedMessageFields
141 } DNS_FREE_TYPE;
142
143 typedef enum _DNS_NAME_FORMAT {
144 DnsNameDomain,
145 DnsNameDomainLabel,
146 DnsNameHostnameFull,
147 DnsNameHostnameLabel,
148 DnsNameWildcard,
149 DnsNameSrvRecord
150 } DNS_NAME_FORMAT;
151
152 typedef enum {
153 DnsSectionQuestion,
154 DnsSectionAnswer,
155 DnsSectionAuthority,
156 DnsSectionAdditional
157 } DNS_SECTION;
158
159 typedef struct _IP4_ARRAY {
160 DWORD AddrCount;
161 IP4_ADDRESS AddrArray[1];
162 } IP4_ARRAY, *PIP4_ARRAY;
163
164 typedef struct {
165 DWORD IP6Dword[4];
166 } IP6_ADDRESS, *PIP6_ADDRESS, DNS_IP6_ADDRESS, *PDNS_IP6_ADDRESS;
167
168 #pragma pack(push, 1)
169
170 typedef struct _DnsAddr
171 {
172 CHAR MaxSa[DNS_ADDR_MAX_SOCKADDR_LENGTH];
173 #if defined(__midl) || defined(__WIDL__)
174 DWORD DnsAddrUserDword[8];
175 #else
176 union {
177 DWORD DnsAddrUserDword[8];
178 } Data;
179 #endif
180 } DNS_ADDR, *PDNS_ADDR;
181
182 typedef struct _DnsAddrArray
183 {
184 DWORD MaxCount;
185 DWORD AddrCount;
186 DWORD Tag;
187 WORD Family;
188 WORD WordReserved;
189 DWORD Flags;
190 DWORD MatchFlag;
191 DWORD Reserved1;
192 DWORD Reserved2;
193 #if defined(__midl) || defined(__WIDL__)
194 [size_is(AddrCount)] DNS_ADDR AddrArray[];
195 #else
196 DNS_ADDR AddrArray[1];
197 #endif
198 } DNS_ADDR_ARRAY, *PDNS_ADDR_ARRAY;
199
200 typedef struct _DNS_HEADER {
201 WORD Xid;
202 BYTE RecursionDesired:1;
203 BYTE Truncation:1;
204 BYTE Authoritative:1;
205 BYTE Opcode:4;
206 BYTE IsResponse:1;
207 BYTE ResponseCode:4;
208 BYTE CheckingDisabled:1;
209 BYTE AuthenticatedData:1;
210 BYTE Reserved:1;
211 BYTE RecursionAvailable:1;
212 WORD QuestionCount;
213 WORD AnswerCount;
214 WORD NameServerCount;
215 WORD AdditionalCount;
216 } DNS_HEADER, *PDNS_HEADER;
217
218 typedef struct _DNS_WIRE_QUESTION {
219 WORD QuestionType;
220 WORD QuestionClass;
221 } DNS_WIRE_QUESTION, *PDNS_WIRE_QUESTION;
222
223 typedef struct _DNS_WIRE_RECORD {
224 WORD RecordType;
225 WORD RecordClass;
226 DWORD TimeToLive;
227 WORD DataLength;
228 } DNS_WIRE_RECORD, *PDNS_WIRE_RECORD;
229
230 #pragma pack(pop)
231
232 typedef struct _DNS_MESSAGE_BUFFER {
233 DNS_HEADER MessageHead;
234 CHAR MessageBody[1];
235 } DNS_MESSAGE_BUFFER, *PDNS_MESSAGE_BUFFER;
236
237 typedef struct _DnsRecordFlags {
238 DWORD Section:2;
239 DWORD Delete:1;
240 DWORD CharSet:2;
241 DWORD Unused:3;
242 DWORD Reserved:24;
243 } DNS_RECORD_FLAGS;
244
245 typedef struct {
246 IP4_ADDRESS IpAddress;
247 } DNS_A_DATA, *PDNS_A_DATA;
248
249 typedef struct {
250 DNS_IP6_ADDRESS Ip6Address;
251 } DNS_AAAA_DATA, *PDNS_AAAA_DATA;
252
253 typedef struct {
254 BYTE AddressType;
255 BYTE Address[DNS_ATMA_MAX_ADDR_LENGTH];
256 } DNS_ATMA_DATA, *PDNS_ATMA_DATA;
257
258 typedef struct {
259 WORD wFlags;
260 BYTE chProtocol;
261 BYTE chAlgorithm;
262 BYTE Key[1];
263 } DNS_KEY_DATA, *PDNS_KEY_DATA;
264
265 typedef struct {
266 WORD wVersion;
267 WORD wSize;
268 WORD wHorPrec;
269 WORD wVerPrec;
270 DWORD dwLatitude;
271 DWORD dwLongitude;
272 DWORD dwAltitude;
273 } DNS_LOC_DATA, *PDNS_LOC_DATA;
274
275 typedef struct {
276 LPSTR pNameMailbox;
277 LPSTR pNameErrorsMailbox;
278 } DNS_MINFO_DATAA, *PDNS_MINFO_DATAA;
279
280 typedef struct {
281 LPWSTR pNameMailbox;
282 LPWSTR pNameErrorsMailbox;
283 } DNS_MINFO_DATAW, *PDNS_MINFO_DATAW;
284
285 typedef struct {
286 LPSTR pNameExchange;
287 WORD wPreference;
288 WORD Pad;
289 } DNS_MX_DATAA, *PDNS_MX_DATAA;
290
291 typedef struct {
292 LPWSTR pNameExchange;
293 WORD wPreference;
294 WORD Pad;
295 } DNS_MX_DATAW, *PDNS_MX_DATAW;
296
297 typedef struct {
298 DWORD dwByteCount;
299 BYTE Data[1];
300 } DNS_NULL_DATA, *PDNS_NULL_DATA;
301
302 typedef struct {
303 LPSTR pNameNext;
304 WORD wNumTypes;
305 WORD wTypes[1];
306 } DNS_NXT_DATAA, *PDNS_NXT_DATAA;
307
308 typedef struct {
309 LPWSTR pNameNext;
310 WORD wNumTypes;
311 WORD wTypes[1];
312 } DNS_NXT_DATAW, *PDNS_NXT_DATAW;
313
314 typedef struct {
315 LPSTR pNameHost;
316 } DNS_PTR_DATAA, *PDNS_PTR_DATAA;
317
318 typedef struct {
319 LPWSTR pNameHost;
320 } DNS_PTR_DATAW, *PDNS_PTR_DATAW;
321
322 typedef struct {
323 LPSTR pNameSigner;
324 WORD wTypeCovered;
325 BYTE chAlgorithm;
326 BYTE chLabelCount;
327 DWORD dwOriginalTtl;
328 DWORD dwExpiration;
329 DWORD dwTimeSigned;
330 WORD wKeyTag;
331 WORD Pad;
332 BYTE Signature[1];
333 } DNS_SIG_DATAA, *PDNS_SIG_DATAA;
334
335 typedef struct {
336 LPWSTR pNameSigner;
337 WORD wTypeCovered;
338 BYTE chAlgorithm;
339 BYTE chLabelCount;
340 DWORD dwOriginalTtl;
341 DWORD dwExpiration;
342 DWORD dwTimeSigned;
343 WORD wKeyTag;
344 WORD Pad;
345 BYTE Signature[1];
346 } DNS_SIG_DATAW, *PDNS_SIG_DATAW;
347
348 typedef struct {
349 LPSTR pNamePrimaryServer;
350 LPSTR pNameAdministrator;
351 DWORD dwSerialNo;
352 DWORD dwRefresh;
353 DWORD dwRetry;
354 DWORD dwExpire;
355 DWORD dwDefaultTtl;
356 } DNS_SOA_DATAA, *PDNS_SOA_DATAA;
357
358 typedef struct {
359 LPWSTR pNamePrimaryServer;
360 LPWSTR pNameAdministrator;
361 DWORD dwSerialNo;
362 DWORD dwRefresh;
363 DWORD dwRetry;
364 DWORD dwExpire;
365 DWORD dwDefaultTtl;
366 } DNS_SOA_DATAW, *PDNS_SOA_DATAW;
367
368 typedef struct {
369 LPSTR pNameTarget;
370 WORD wPriority;
371 WORD wWeight;
372 WORD wPort;
373 WORD Pad;
374 } DNS_SRV_DATAA, *PDNS_SRV_DATAA;
375
376 typedef struct {
377 LPWSTR pNameTarget;
378 WORD wPriority;
379 WORD wWeight;
380 WORD wPort;
381 WORD Pad;
382 } DNS_SRV_DATAW, *PDNS_SRV_DATAW;
383
384 typedef struct {
385 DWORD dwStringCount;
386 LPSTR pStringArray[1];
387 } DNS_TXT_DATAA, *PDNS_TXT_DATAA;
388
389 typedef struct {
390 DWORD dwStringCount;
391 LPWSTR pStringArray[1];
392 } DNS_TXT_DATAW, *PDNS_TXT_DATAW;
393
394 typedef struct {
395 LPSTR pNameAlgorithm;
396 PBYTE pAlgorithmPacket;
397 PBYTE pKey;
398 PBYTE pOtherData;
399 DWORD dwCreateTime;
400 DWORD dwExpireTime;
401 WORD wMode;
402 WORD wError;
403 WORD wKeyLength;
404 WORD wOtherLength;
405 UCHAR cAlgNameLength;
406 BOOL bPacketPointers;
407 } DNS_TKEY_DATAA, *PDNS_TKEY_DATAA;
408
409 typedef struct {
410 LPWSTR pNameAlgorithm;
411 PBYTE pAlgorithmPacket;
412 PBYTE pKey;
413 PBYTE pOtherData;
414 DWORD dwCreateTime;
415 DWORD dwExpireTime;
416 WORD wMode;
417 WORD wError;
418 WORD wKeyLength;
419 WORD wOtherLength;
420 UCHAR cAlgNameLength;
421 BOOL bPacketPointers;
422 } DNS_TKEY_DATAW, *PDNS_TKEY_DATAW;
423
424 typedef struct {
425 LPSTR pNameAlgorithm;
426 PBYTE pAlgorithmPacket;
427 PBYTE pSignature;
428 PBYTE pOtherData;
429 LONGLONG i64CreateTime;
430 WORD wFudgeTime;
431 WORD wOriginalXid;
432 WORD wError;
433 WORD wSigLength;
434 WORD wOtherLength;
435 UCHAR cAlgNameLength;
436 BOOL bPacketPointers;
437 } DNS_TSIG_DATAA, *PDNS_TSIG_DATAA;
438
439 typedef struct {
440 LPWSTR pNameAlgorithm;
441 PBYTE pAlgorithmPacket;
442 PBYTE pSignature;
443 PBYTE pOtherData;
444 LONGLONG i64CreateTime;
445 WORD wFudgeTime;
446 WORD wOriginalXid;
447 WORD wError;
448 WORD wSigLength;
449 WORD wOtherLength;
450 UCHAR cAlgNameLength;
451 BOOL bPacketPointers;
452 } DNS_TSIG_DATAW, *PDNS_TSIG_DATAW;
453
454 typedef struct {
455 DWORD dwMappingFlag;
456 DWORD dwLookupTimeout;
457 DWORD dwCacheTimeout;
458 DWORD cWinsServerCount;
459 IP4_ADDRESS WinsServers[1];
460 } DNS_WINS_DATA, *PDNS_WINS_DATA;
461
462 typedef struct {
463 DWORD dwMappingFlag;
464 DWORD dwLookupTimeout;
465 DWORD dwCacheTimeout;
466 LPSTR pNameResultDomain;
467 } DNS_WINSR_DATAA, *PDNS_WINSR_DATAA;
468
469 typedef struct {
470 DWORD dwMappingFlag;
471 DWORD dwLookupTimeout;
472 DWORD dwCacheTimeout;
473 LPWSTR pNameResultDomain;
474 } DNS_WINSR_DATAW, *PDNS_WINSR_DATAW;
475
476 typedef struct {
477 IP4_ADDRESS IpAddress;
478 UCHAR chProtocol;
479 BYTE BitMask[1];
480 } DNS_WKS_DATA, *PDNS_WKS_DATA;
481
482 typedef struct {
483 WORD wKeyTag;
484 BYTE chAlgorithm;
485 BYTE chDigestType;
486 WORD wDigestLength;
487 WORD wPad;
488 BYTE Digest[1];
489 } DNS_DS_DATA;
490
491 typedef struct {
492 LPWSTR pNextDomainName;
493 WORD wTypeBitMapsLength;
494 WORD wPad;
495 BYTE TypeBitMaps[1];
496 } DNS_NSEC_DATAW;
497
498 typedef struct {
499 WORD wFlags;
500 BYTE chProtocol;
501 BYTE chAlgorithm;
502 WORD wKeyLength;
503 WORD wPad;
504 BYTE Key[1];
505 } DNS_DNSKEY_DATA;
506
507 typedef struct {
508 WORD wDataLength;
509 WORD wPad;
510 BYTE Data[1];
511 } DNS_OPT_DATA;
512
513 typedef struct {
514 WORD wTypeCovered;
515 BYTE chAlgorithm;
516 BYTE chLabelCount;
517 DWORD dwOriginalTtl;
518 DWORD dwExpiration;
519 DWORD dwTimeSigned;
520 WORD wKeyTag;
521 WORD Pad;
522 LPWSTR pNameSigner;
523 BYTE Signature[1];
524 } DNS_RRSIG_DATAW;
525
526 #if defined(__midl) || defined(__WIDL__)
527 typedef [switch_type(unsigned short )] union DNS_DATAW {
528 [case(1)] DNS_A_DATA A;
529 [case(6)] DNS_SOA_DATAW SOA;
530 [case(12)] DNS_PTR_DATAW PTR;
531 [case(2)] DNS_PTR_DATAW NS;
532 [case(5)] DNS_PTR_DATAW CNAME;
533 [case(7)] DNS_PTR_DATAW MB;
534 [case(3)] DNS_PTR_DATAW MD;
535 [case(4)] DNS_PTR_DATAW MF;
536 [case(8)] DNS_PTR_DATAW MG;
537 [case(9)] DNS_PTR_DATAW MR;
538 [case(14)] DNS_MINFO_DATAW MINFO;
539 [case(17)] DNS_MINFO_DATAW RP;
540 [case(15)] DNS_MX_DATAW MX;
541 [case(18)] DNS_MX_DATAW AFSDB;
542 [case(21)] DNS_MX_DATAW RT;
543 [case(28)] DNS_AAAA_DATA AAAA;
544 [case(33)] DNS_SRV_DATAW SRV;
545 [case(34)] DNS_ATMA_DATA ATMA;
546 [case(43)] DNS_DS_DATA DS;
547 [case(46)] DNS_RRSIG_DATAW RRSIG;
548 [case(47)] DNS_NSEC_DATAW NSEC;
549 [case(48)] DNS_DNSKEY_DATA DNSKEY;
550 [case(41)] DNS_OPT_DATA OPT;
551 } DNS_DATAW;
552
553 typedef struct _DnsRecordW {
554 [unique]struct _DnsRecordW *pNext;
555 [unique][string] LPWSTR pName;
556 WORD wType;
557 WORD wDataLength;
558 DWORD Flags;
559 DWORD dwTtl;
560 DWORD dwReserved;
561 [switch_is(wType)] DNS_DATAW Data;
562 } DNS_RECORDW, *PDNS_RECORDW;
563 #else
564 typedef struct _DnsRecordA {
565 struct _DnsRecordA* pNext;
566 LPSTR pName;
567 WORD wType;
568 WORD wDataLength;
569 union {
570 DWORD DW;
571 DNS_RECORD_FLAGS S;
572 } Flags;
573 DWORD dwTtl;
574 DWORD dwReserved;
575 union {
576 DNS_A_DATA A;
577 DNS_SOA_DATAA SOA, Soa;
578 DNS_PTR_DATAA PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
579 DNS_MINFO_DATAA MINFO, Minfo, RP, Rp;
580 DNS_MX_DATAA MX, Mx, AFSDB, Afsdb, RT, Rt;
581 DNS_TXT_DATAA HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
582 DNS_NULL_DATA Null;
583 DNS_WKS_DATA WKS, Wks;
584 DNS_AAAA_DATA AAAA;
585 DNS_KEY_DATA KEY, Key;
586 DNS_SIG_DATAA SIG, Sig;
587 DNS_ATMA_DATA ATMA, Atma;
588 DNS_NXT_DATAA NXT, Nxt;
589 DNS_SRV_DATAA SRV, Srv;
590 DNS_TKEY_DATAA TKEY, Tkey;
591 DNS_TSIG_DATAA TSIG, Tsig;
592 DNS_WINS_DATA WINS, Wins;
593 DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
594 } Data;
595 } DNS_RECORDA, *PDNS_RECORDA;
596
597 typedef struct _DnsRecordW {
598 struct _DnsRecordW* pNext;
599 LPWSTR pName;
600 WORD wType;
601 WORD wDataLength;
602 union {
603 DWORD DW;
604 DNS_RECORD_FLAGS S;
605 } Flags;
606 DWORD dwTtl;
607 DWORD dwReserved;
608 union {
609 DNS_A_DATA A;
610 DNS_SOA_DATAW SOA, Soa;
611 DNS_PTR_DATAW PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
612 DNS_MINFO_DATAW MINFO, Minfo, RP, Rp;
613 DNS_MX_DATAW MX, Mx, AFSDB, Afsdb, RT, Rt;
614 DNS_TXT_DATAW HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
615 DNS_NULL_DATA Null;
616 DNS_WKS_DATA WKS, Wks;
617 DNS_AAAA_DATA AAAA;
618 DNS_KEY_DATA KEY, Key;
619 DNS_SIG_DATAW SIG, Sig;
620 DNS_ATMA_DATA ATMA, Atma;
621 DNS_NXT_DATAW NXT, Nxt;
622 DNS_SRV_DATAW SRV, Srv;
623 DNS_TKEY_DATAW TKEY, Tkey;
624 DNS_TSIG_DATAW TSIG, Tsig;
625 DNS_WINS_DATA WINS, Wins;
626 DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
627 } Data;
628 } DNS_RECORDW, *PDNS_RECORDW;
629
630 #ifdef UNICODE
631 #define DNS_RECORD DNS_RECORDW
632 #define PDNS_RECORD PDNS_RECORDW
633 #else
634 #define DNS_RECORD DNS_RECORDA
635 #define PDNS_RECORD PDNS_RECORDA
636 #endif
637
638 #endif
639
640 typedef struct _DnsRRSet {
641 PDNS_RECORD pFirstRR;
642 PDNS_RECORD pLastRR;
643 } DNS_RRSET, *PDNS_RRSET;
644
645 #define DNS_RRSET_INIT(rrset) \
646 { \
647 PDNS_RRSET _prrset = &(rrset); \
648 _prrset->pFirstRR = NULL; \
649 _prrset->pLastRR = (PDNS_RECORD) &_prrset->pFirstRR; \
650 }
651
652 #define DNS_RRSET_ADD(rrset, pnewRR) \
653 { \
654 PDNS_RRSET _prrset = &(rrset); \
655 PDNS_RECORD _prrnew = (pnewRR); \
656 _prrset->pLastRR->pNext = _prrnew; \
657 _prrset->pLastRR = _prrnew; \
658 }
659
660 #define DNS_RRSET_TERMINATE(rrset) \
661 { \
662 PDNS_RRSET _prrset = &(rrset); \
663 _prrset->pLastRR->pNext = NULL; \
664 }
665
666 #ifndef __WIDL__
667 // HACK
668
669 DNS_STATUS
670 WINAPI
671 DnsAcquireContextHandle_A(
672 _In_ DWORD CredentialFlags,
673 _In_opt_ PVOID Credentials,
674 _Outptr_ PHANDLE pContext);
675
676 DNS_STATUS
677 WINAPI
678 DnsAcquireContextHandle_W(
679 _In_ DWORD CredentialFlags,
680 _In_opt_ PVOID Credentials,
681 _Outptr_ PHANDLE pContext);
682
683 DNS_STATUS
684 WINAPI
685 DnsExtractRecordsFromMessage_W(
686 _In_ PDNS_MESSAGE_BUFFER pDnsBuffer,
687 _In_ WORD wMessageLength,
688 _Outptr_ PDNS_RECORD *ppRecord);
689
690 DNS_STATUS
691 WINAPI
692 DnsExtractRecordsFromMessage_UTF8(
693 _In_ PDNS_MESSAGE_BUFFER pDnsBuffer,
694 _In_ WORD wMessageLength,
695 _Outptr_ PDNS_RECORD *ppRecord);
696
697 DNS_STATUS
698 WINAPI
699 DnsModifyRecordsInSet_A(
700 _In_opt_ PDNS_RECORD pAddRecords,
701 _In_opt_ PDNS_RECORD pDeleteRecords,
702 _In_ DWORD Options,
703 _In_opt_ HANDLE hCredentials,
704 _Inout_opt_ PIP4_ARRAY pExtraList,
705 _Inout_opt_ PVOID pReserved);
706
707 DNS_STATUS
708 WINAPI
709 DnsModifyRecordsInSet_W(
710 _In_opt_ PDNS_RECORD pAddRecords,
711 _In_opt_ PDNS_RECORD pDeleteRecords,
712 _In_ DWORD Options,
713 _In_opt_ HANDLE hCredentials,
714 _Inout_opt_ PIP4_ARRAY pExtraList,
715 _Inout_opt_ PVOID pReserved);
716
717 DNS_STATUS
718 WINAPI
719 DnsModifyRecordsInSet_UTF8(
720 _In_opt_ PDNS_RECORD pAddRecords,
721 _In_opt_ PDNS_RECORD pDeleteRecords,
722 _In_ DWORD Options,
723 _In_opt_ HANDLE hCredentials,
724 _Inout_opt_ PIP4_ARRAY pExtraList,
725 _Inout_opt_ PVOID pReserved);
726
727 BOOL
728 WINAPI
729 DnsNameCompare_A(
730 _In_ PCSTR pszName1,
731 _In_ PCSTR pszName2);
732
733 BOOL
734 WINAPI
735 DnsNameCompare_W(
736 _In_ PCWSTR pszwName1,
737 _In_ PCWSTR pszwName2);
738
739 DNS_STATUS
740 WINAPI
741 DnsQuery_A(
742 _In_ PCSTR pszName,
743 _In_ WORD wType,
744 _In_ DWORD Options,
745 _Inout_opt_ PIP4_ARRAY pExtra,
746 _Outptr_result_maybenull_ PDNS_RECORD *ppQueryResults,
747 _Outptr_opt_result_maybenull_ PVOID *pReserved);
748
749 DNS_STATUS
750 WINAPI
751 DnsQuery_W(
752 _In_ PCWSTR pszName,
753 _In_ WORD wType,
754 _In_ DWORD Options,
755 _Inout_opt_ PIP4_ARRAY pExtra,
756 _Outptr_result_maybenull_ PDNS_RECORD *ppQueryResults,
757 _Outptr_opt_result_maybenull_ PVOID *pReserved);
758
759 DNS_STATUS
760 WINAPI
761 DnsQuery_UTF8(
762 _In_ PCSTR pszName,
763 _In_ WORD wType,
764 _In_ DWORD Options,
765 _Inout_opt_ PIP4_ARRAY pExtra,
766 _Outptr_result_maybenull_ PDNS_RECORD *ppQueryResults,
767 _Outptr_opt_result_maybenull_ PVOID *pReserved);
768
769 DNS_STATUS
770 WINAPI
771 DnsQueryConfig(
772 _In_ DNS_CONFIG_TYPE Config,
773 _In_ DWORD Flag,
774 _In_opt_ PWSTR pwsAdapterName,
775 _In_opt_ PVOID pReserved,
776 _Out_writes_bytes_to_opt_(*pBufLen, *pBufLen) PVOID pBuffer,
777 _Inout_ PDWORD pBufLen);
778
779 BOOL
780 WINAPI
781 DnsRecordCompare(
782 _In_ PDNS_RECORD,
783 _In_ PDNS_RECORD);
784
785 PDNS_RECORD
786 WINAPI
787 DnsRecordCopyEx(
788 _In_ PDNS_RECORD pRecord,
789 _In_ DNS_CHARSET CharSetIn,
790 _In_ DNS_CHARSET CharSetOut);
791
792 void
793 WINAPI
794 DnsRecordListFree(
795 _Inout_opt_ PDNS_RECORD,
796 _In_ DNS_FREE_TYPE);
797
798 BOOL
799 WINAPI
800 DnsRecordSetCompare(
801 _Inout_ PDNS_RECORD pRR1,
802 _Inout_ PDNS_RECORD pRR2,
803 _Outptr_opt_result_maybenull_ PDNS_RECORD *ppDiff1,
804 _Outptr_opt_result_maybenull_ PDNS_RECORD *ppDiff2);
805
806 PDNS_RECORD
807 WINAPI
808 DnsRecordSetCopyEx(
809 _In_ PDNS_RECORD pRecordSet,
810 _In_ DNS_CHARSET CharSetIn,
811 _In_ DNS_CHARSET CharSetOut);
812
813 PDNS_RECORD
814 WINAPI
815 DnsRecordSetDetach(
816 _Inout_ PDNS_RECORD);
817
818 void
819 WINAPI
820 DnsReleaseContextHandle(
821 _In_ HANDLE);
822
823 DNS_STATUS
824 WINAPI
825 DnsReplaceRecordSetA(
826 _In_ PDNS_RECORD pReplaceSet,
827 _In_ DWORD Options,
828 _In_opt_ HANDLE hContext,
829 _Inout_opt_ PIP4_ARRAY pExtraInfo,
830 _Inout_opt_ PVOID pReserved);
831
832 DNS_STATUS
833 WINAPI
834 DnsReplaceRecordSetW(
835 _In_ PDNS_RECORD pReplaceSet,
836 _In_ DWORD Options,
837 _In_opt_ HANDLE hContext,
838 _Inout_opt_ PIP4_ARRAY pExtraInfo,
839 _Inout_opt_ PVOID pReserved);
840
841 DNS_STATUS
842 WINAPI
843 DnsReplaceRecordSetUTF8(
844 _In_ PDNS_RECORD pReplaceSet,
845 _In_ DWORD Options,
846 _In_opt_ HANDLE hContext,
847 _Inout_opt_ PIP4_ARRAY pExtraInfo,
848 _Inout_opt_ PVOID pReserved);
849
850 DNS_STATUS
851 WINAPI
852 DnsValidateName_A(
853 _In_ LPCSTR,
854 _In_ DNS_NAME_FORMAT);
855
856 DNS_STATUS
857 WINAPI
858 DnsValidateName_W(
859 _In_ LPCWSTR,
860 _In_ DNS_NAME_FORMAT);
861
862 DNS_STATUS
863 WINAPI
864 DnsValidateName_UTF8(
865 _In_ LPCSTR,
866 _In_ DNS_NAME_FORMAT);
867
868 BOOL
869 WINAPI
870 DnsWriteQuestionToBuffer_W(
871 _Inout_ PDNS_MESSAGE_BUFFER pDnsBuffer,
872 _Inout_ PDWORD pdwBufferSize,
873 _In_ LPWSTR pszName,
874 _In_ WORD wType,
875 _In_ WORD Xid,
876 _In_ BOOL fRecursionDesired);
877
878 BOOL
879 WINAPI
880 DnsWriteQuestionToBuffer_UTF8(
881 _Inout_ PDNS_MESSAGE_BUFFER pDnsBuffer,
882 _Inout_ PDWORD pdwBufferSize,
883 _In_ LPSTR pszName,
884 _In_ WORD wType,
885 _In_ WORD Xid,
886 _In_ BOOL fRecursionDesired);
887 #endif
888
889 #ifdef UNICODE
890
891 #define DNS_MINFO_DATA DNS_MINFO_DATAW
892 #define PDNS_MINFO_DATA PDNS_MINFO_DATAW
893 #define DNS_MX_DATA DNS_MX_DATAW
894 #define PDNS_MX_DATA PDNS_MX_DATAW
895 #define DNS_NXT_DATA DNS_NXT_DATAW
896 #define PDNS_NXT_DATA PDNS_NXT_DATAW
897 #define DNS_PTR_DATA DNS_PTR_DATAW
898 #define PDNS_PTR_DATA PDNS_PTR_DATAW
899 #define DNS_SIG_DATA DNS_SIG_DATAW
900 #define PDNS_SIG_DATA PDNS_SIG_DATAW
901 #define DNS_SOA_DATA DNS_SOA_DATAW
902 #define PDNS_SOA_DATA PDNS_SOA_DATAW
903 #define DNS_TXT_DATA DNS_TXT_DATAW
904 #define PDNS_TXT_DATA PDNS_TXT_DATAW
905 #define DNS_TKEY_DATA DNS_TKEY_DATAW
906 #define PDNS_TKEY_DATA PDNS_TKEY_DATAW
907 #define DNS_WINSR_DATA DNS_WINSR_DATAW
908 #define PDNS_WINSR_DATA PDNS_WINSR_DATAW
909 #define DnsAcquireContextHandle DnsAcquireContextHandle_W
910 #define DnsModifyRecordsInSet DnsModifyRecordsInSet_W
911 #define DnsNameCompare DnsNameCompare_W
912 #define DnsQuery DnsQuery_W
913 #define DnsReplaceRecordSet DnsReplaceRecordSetW
914 #define DnsValidateName DnsValidateName_W
915
916 #else /* UNICODE */
917
918 #define DNS_MINFO_DATA DNS_MINFO_DATAA
919 #define PDNS_MINFO_DATA PDNS_MINFO_DATAA
920 #define DNS_MX_DATA DNS_MX_DATAA
921 #define PDNS_MX_DATA PDNS_MX_DATAA
922 #define DNS_NXT_DATA DNS_NXT_DATAA
923 #define PDNS_NXT_DATA PDNS_NXT_DATAA
924 #define DNS_PTR_DATA DNS_PTR_DATAA
925 #define PDNS_PTR_DATA PDNS_PTR_DATAA
926 #define DNS_SIG_DATA DNS_SIG_DATAA
927 #define PDNS_SIG_DATA PDNS_SIG_DATAA
928 #define DNS_SOA_DATA DNS_SOA_DATAA
929 #define PDNS_SOA_DATA PDNS_SOA_DATAA
930 #define DNS_TXT_DATA DNS_TXT_DATAA
931 #define PDNS_TXT_DATA PDNS_TXT_DATAA
932 #define DNS_TKEY_DATA DNS_TKEY_DATAA
933 #define PDNS_TKEY_DATA PDNS_TKEY_DATAA
934 #define DNS_WINSR_DATA DNS_WINSR_DATAA
935 #define PDNS_WINSR_DATA PDNS_WINSR_DATAA
936 #define DnsAcquireContextHandle DnsAcquireContextHandle_A
937 #define DnsModifyRecordsInSet DnsModifyRecordsInSet_A
938 #define DnsNameCompare DnsNameCompare_A
939 #define DnsQuery DnsQuery_A
940 #define DnsReplaceRecordSet DnsReplaceRecordSetA
941 #define DnsValidateName DnsValidateName_A
942
943 #endif /* UNICODE */
944
945 #endif /* RC_INVOKED */
946
947 #ifdef __cplusplus
948 }
949 #endif
950
951 #endif /* _WINDNS_INCLUDED_ */