windns.h 17 KB
Newer Older
Hans Leidekker's avatar
Hans Leidekker committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * DNS support
 *
 * Copyright (C) 2006 Matthew Kehrer
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
Hans Leidekker's avatar
Hans Leidekker committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
 */

#ifndef __WINE_WINDNS_H
#define __WINE_WINDNS_H

#ifdef __cplusplus
extern "C" {
#endif

#define DNS_TYPE_ZERO       0x0000
#define DNS_TYPE_A          0x0001
#define DNS_TYPE_NS         0x0002
#define DNS_TYPE_MD         0x0003
#define DNS_TYPE_MF         0x0004
#define DNS_TYPE_CNAME      0x0005
#define DNS_TYPE_SOA        0x0006
#define DNS_TYPE_MB         0x0007
#define DNS_TYPE_MG         0x0008
#define DNS_TYPE_MR         0x0009
#define DNS_TYPE_NULL       0x000a
#define DNS_TYPE_WKS        0x000b
#define DNS_TYPE_PTR        0x000c
#define DNS_TYPE_HINFO      0x000d
#define DNS_TYPE_MINFO      0x000e
#define DNS_TYPE_MX         0x000f
#define DNS_TYPE_TEXT       0x0010
#define DNS_TYPE_RP         0x0011
#define DNS_TYPE_AFSDB      0x0012
#define DNS_TYPE_X25        0x0013
#define DNS_TYPE_ISDN       0x0014
#define DNS_TYPE_RT         0x0015
#define DNS_TYPE_NSAP       0x0016
#define DNS_TYPE_NSAPPTR    0x0017
#define DNS_TYPE_SIG        0x0018
#define DNS_TYPE_KEY        0x0019
#define DNS_TYPE_PX         0x001a
#define DNS_TYPE_GPOS       0x001b
#define DNS_TYPE_AAAA       0x001c
#define DNS_TYPE_LOC        0x001d
#define DNS_TYPE_NXT        0x001e
#define DNS_TYPE_EID        0x001f
#define DNS_TYPE_NIMLOC     0x0020
#define DNS_TYPE_SRV        0x0021
#define DNS_TYPE_ATMA       0x0022
#define DNS_TYPE_NAPTR      0x0023
#define DNS_TYPE_KX         0x0024
#define DNS_TYPE_CERT       0x0025
#define DNS_TYPE_A6         0x0026
#define DNS_TYPE_DNAME      0x0027
#define DNS_TYPE_SINK       0x0028
#define DNS_TYPE_OPT        0x0029
#define DNS_TYPE_UINFO      0x0064
#define DNS_TYPE_UID        0x0065
#define DNS_TYPE_GID        0x0066
#define DNS_TYPE_UNSPEC     0x0067
#define DNS_TYPE_ADDRS      0x00f8
#define DNS_TYPE_TKEY       0x00f9
#define DNS_TYPE_TSIG       0x00fa
#define DNS_TYPE_IXFR       0x00fb
#define DNS_TYPE_AXFR       0x00fc
#define DNS_TYPE_MAILB      0x00fd
#define DNS_TYPE_MAILA      0x00fe
#define DNS_TYPE_ALL        0x00ff
#define DNS_TYPE_ANY        0x00ff

#define DNS_TYPE_WINS       0xff01
#define DNS_TYPE_WINSR      0xff02
#define DNS_TYPE_NBSTAT     (DNS_TYPE_WINSR)

#define DNS_QUERY_STANDARD                  0x00000000
#define DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE 0x00000001
#define DNS_QUERY_USE_TCP_ONLY              0x00000002
#define DNS_QUERY_NO_RECURSION              0x00000004
#define DNS_QUERY_BYPASS_CACHE              0x00000008
#define DNS_QUERY_NO_WIRE_QUERY             0x00000010
#define DNS_QUERY_NO_LOCAL_NAME             0x00000020
#define DNS_QUERY_NO_HOSTS_FILE             0x00000040
#define DNS_QUERY_NO_NETBT                  0x00000080
#define DNS_QUERY_WIRE_ONLY                 0x00000100
#define DNS_QUERY_RETURN_MESSAGE            0x00000200
#define DNS_QUERY_TREAT_AS_FQDN             0x00001000
#define DNS_QUERY_DONT_RESET_TTL_VALUES     0x00100000
#define DNS_QUERY_RESERVED                  0xff000000

typedef enum _DNS_NAME_FORMAT
{
    DnsNameDomain,
    DnsNameDomainLabel,
    DnsNameHostnameFull,
    DnsNameHostnameLabel,
    DnsNameWildcard,
    DnsNameSrvRecord
} DNS_NAME_FORMAT;

typedef enum _DNS_FREE_TYPE
{
    DnsFreeFlat,
    DnsFreeRecordList,
    DnsFreeParsedMessageFields
} DNS_FREE_TYPE;

typedef enum _DNS_CHARSET
{
    DnsCharSetUnknown,
    DnsCharSetUnicode,
    DnsCharSetUtf8,
    DnsCharSetAnsi
} DNS_CHARSET;

typedef enum _DNS_CONFIG_TYPE
{
    DnsConfigPrimaryDomainName_W,
    DnsConfigPrimaryDomainName_A,
    DnsConfigPrimaryDomainName_UTF8,
    DnsConfigAdapterDomainName_W,
    DnsConfigAdapterDomainName_A,
    DnsConfigAdapterDomainName_UTF8,
    DnsConfigDnsServerList,
    DnsConfigSearchList,
    DnsConfigAdapterInfo,
    DnsConfigPrimaryHostNameRegistrationEnabled,
    DnsConfigAdapterHostNameRegistrationEnabled,
    DnsConfigAddressRegistrationMaxCount,
    DnsConfigHostName_W,
    DnsConfigHostName_A,
    DnsConfigHostName_UTF8,
    DnsConfigFullHostName_W,
    DnsConfigFullHostName_A,
    DnsConfigFullHostName_UTF8
} DNS_CONFIG_TYPE;

typedef enum _DnsSection
{
    DnsSectionQuestion,
    DnsSectionAnswer,
    DnsSectionAuthority,
155
    DnsSectionAddtional /* Not a typo, as per Microsoft's headers */
Hans Leidekker's avatar
Hans Leidekker committed
156 157
} DNS_SECTION;

158
typedef LONG DNS_STATUS, *PDNS_STATUS;
159
typedef DWORD IP4_ADDRESS, *PIP4_ADDRESS;
Hans Leidekker's avatar
Hans Leidekker committed
160 161 162 163 164 165

typedef struct
{
    DWORD IP6Dword[4];
} IP6_ADDRESS, *PIP6_ADDRESS, DNS_IP6_ADDRESS, *PDNS_IP6_ADDRESS;

166 167 168 169 170 171 172
#define SIZEOF_IP4_ADDRESS                   4
#define IP4_ADDRESS_STRING_LENGTH           16
#define IP6_ADDRESS_STRING_LENGTH           65
#define DNS_ADDRESS_STRING_LENGTH           IP6_ADDRESS_STRING_LENGTH
#define IP4_ADDRESS_STRING_BUFFER_LENGTH    IP4_ADDRESS_STRING_LENGTH
#define IP6_ADDRESS_STRING_BUFFER_LENGTH    IP6_ADDRESS_STRING_LENGTH

Hans Leidekker's avatar
Hans Leidekker committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
typedef struct _IP4_ARRAY
{
    DWORD AddrCount;
    IP4_ADDRESS AddrArray[1];
} IP4_ARRAY, *PIP4_ARRAY;

typedef struct _DNS_HEADER
{
    WORD Xid;
    BYTE RecursionDesired;
    BYTE Truncation;
    BYTE Authoritative;
    BYTE Opcode;
    BYTE IsResponse;
    BYTE ResponseCode;
    BYTE Reserved;
    BYTE RecursionAvailable;
    WORD QuestionCount;
    WORD AnswerCount;
    WORD NameServerCount;
    WORD AdditionalCount;
} DNS_HEADER, *PDNS_HEADER;

typedef struct _DNS_MESSAGE_BUFFER
{
    DNS_HEADER MessageHead;
    CHAR MessageBody[1];
} DNS_MESSAGE_BUFFER, *PDNS_MESSAGE_BUFFER;

typedef struct
{
    IP4_ADDRESS IpAddress;
} DNS_A_DATA, *PDNS_A_DATA;

typedef struct _DnsRecordFlags
{
    DWORD Section :2;
    DWORD Delete :1;
    DWORD CharSet :2;
    DWORD Unused :3;
    DWORD Reserved :24;
} DNS_RECORD_FLAGS;

typedef struct
{
218 219
    PSTR  pNamePrimaryServer;
    PSTR  pNameAdministrator;
Hans Leidekker's avatar
Hans Leidekker committed
220 221 222 223 224 225 226 227 228
    DWORD dwSerialNo;
    DWORD dwRefresh;
    DWORD dwRetry;
    DWORD dwExpire;
    DWORD dwDefaultTtl;
} DNS_SOA_DATAA, *PDNS_SOA_DATAA;

typedef struct
{
229 230
    PWSTR pNamePrimaryServer;
    PWSTR pNameAdministrator;
Hans Leidekker's avatar
Hans Leidekker committed
231 232 233 234 235 236 237 238 239 240 241 242
    DWORD dwSerialNo;
    DWORD dwRefresh;
    DWORD dwRetry;
    DWORD dwExpire;
    DWORD dwDefaultTtl;
} DNS_SOA_DATAW, *PDNS_SOA_DATAW;

DECL_WINELIB_TYPE_AW(DNS_SOA_DATA)
DECL_WINELIB_TYPE_AW(PDNS_SOA_DATA)

typedef struct
{
243
    PSTR pNameHost;
Hans Leidekker's avatar
Hans Leidekker committed
244 245 246 247
} DNS_PTR_DATAA, *PDNS_PTR_DATAA;

typedef struct
{
248
    PWSTR pNameHost;
Hans Leidekker's avatar
Hans Leidekker committed
249 250 251 252 253 254 255
} DNS_PTR_DATAW, *PDNS_PTR_DATAW;

DECL_WINELIB_TYPE_AW(DNS_PTR_DATA)
DECL_WINELIB_TYPE_AW(PDNS_PTR_DATA)

typedef struct
{
256 257
    PSTR pNameMailbox;
    PSTR pNameErrorsMailbox;
Hans Leidekker's avatar
Hans Leidekker committed
258 259 260 261
} DNS_MINFO_DATAA, *PDNS_MINFO_DATAA;

typedef struct
{
262 263
    PWSTR pNameMailbox;
    PWSTR pNameErrorsMailbox;
Hans Leidekker's avatar
Hans Leidekker committed
264 265 266 267 268 269 270
} DNS_MINFO_DATAW, *PDNS_MINFO_DATAW;

DECL_WINELIB_TYPE_AW(DNS_MINFO_DATA)
DECL_WINELIB_TYPE_AW(PDNS_MINFO_DATA)

typedef struct
{
271
    PSTR pNameExchange;
Hans Leidekker's avatar
Hans Leidekker committed
272 273 274 275 276 277
    WORD wPreference;
    WORD Pad;
} DNS_MX_DATAA, *PDNS_MX_DATAA;

typedef struct
{
278
    PWSTR pNameExchange;
Hans Leidekker's avatar
Hans Leidekker committed
279 280 281 282 283 284 285 286 287 288
    WORD wPreference;
    WORD Pad;
} DNS_MX_DATAW, *PDNS_MX_DATAW;

DECL_WINELIB_TYPE_AW(DNS_MX_DATA)
DECL_WINELIB_TYPE_AW(PDNS_MX_DATA)

typedef struct
{
    DWORD dwStringCount;
289
    PSTR pStringArray[1];
Hans Leidekker's avatar
Hans Leidekker committed
290 291 292 293 294
} DNS_TXT_DATAA, *PDNS_TXT_DATAA;

typedef struct
{
    DWORD dwStringCount;
295
    PWSTR pStringArray[1];
Hans Leidekker's avatar
Hans Leidekker committed
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
} DNS_TXT_DATAW, *PDNS_TXT_DATAW;

DECL_WINELIB_TYPE_AW(DNS_TXT_DATA)
DECL_WINELIB_TYPE_AW(PDNS_TXT_DATA)

typedef struct
{
    DWORD dwByteCount;
    BYTE Data[1];
} DNS_NULL_DATA, *PDNS_NULL_DATA;

typedef struct
{
    IP4_ADDRESS IpAddress;
    UCHAR chProtocol;
    BYTE BitMask[1];
} DNS_WKS_DATA, *PDNS_WKS_DATA;

typedef struct
{
    DNS_IP6_ADDRESS Ip6Address;
} DNS_AAAA_DATA, *PDNS_AAAA_DATA;

typedef struct
{
    WORD wFlags;
    BYTE chProtocol;
    BYTE chAlgorithm;
    BYTE Key[1];
} DNS_KEY_DATA, *PDNS_KEY_DATA;

typedef struct
{
    WORD wVersion;
    WORD wSize;
    WORD wHorPrec;
    WORD wVerPrec;
    DWORD dwLatitude;
    DWORD dwLongitude;
    DWORD dwAltitude;
} DNS_LOC_DATA, *PDNS_LOC_DATA;

typedef struct
{
340
    PSTR pNameSigner;
Hans Leidekker's avatar
Hans Leidekker committed
341 342 343 344 345 346 347 348 349 350 351 352 353
    WORD wTypeCovered;
    BYTE chAlgorithm;
    BYTE chLabelCount;
    DWORD dwOriginalTtl;
    DWORD dwExpiration;
    DWORD dwTimeSigned;
    WORD wKeyTag;
    WORD Pad;
    BYTE Signature[1];
} DNS_SIG_DATAA, *PDNS_SIG_DATAA;

typedef struct
{
354
    PWSTR pNameSigner;
Hans Leidekker's avatar
Hans Leidekker committed
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
    WORD wTypeCovered;
    BYTE chAlgorithm;
    BYTE chLabelCount;
    DWORD dwOriginalTtl;
    DWORD dwExpiration;
    DWORD dwTimeSigned;
    WORD wKeyTag;
    WORD Pad;
    BYTE Signature[1];
} DNS_SIG_DATAW, *PDNS_SIG_DATAW;

DECL_WINELIB_TYPE_AW(DNS_SIG_DATA)
DECL_WINELIB_TYPE_AW(PDNS_SIG_DATA)

#define DNS_ATMA_MAX_ADDR_LENGTH 20

typedef struct
{
    BYTE AddressType;
    BYTE Address[DNS_ATMA_MAX_ADDR_LENGTH];
} DNS_ATMA_DATA, *PDNS_ATMA_DATA;

typedef struct
{
379
    PSTR pNameNext;
Hans Leidekker's avatar
Hans Leidekker committed
380 381 382 383 384 385
    WORD wNumTypes;
    WORD wTypes[1];
} DNS_NXT_DATAA, *PDNS_NXT_DATAA;

typedef struct
{
386
    PWSTR pNameNext;
Hans Leidekker's avatar
Hans Leidekker committed
387 388 389 390 391 392 393 394 395
    WORD wNumTypes;
    WORD wTypes[1];
} DNS_NXT_DATAW, *PDNS_NXT_DATAW;

DECL_WINELIB_TYPE_AW(DNS_NXT_DATA)
DECL_WINELIB_TYPE_AW(PDNS_NXT_DATA)

typedef struct
{
396
    PSTR pNameTarget;
Hans Leidekker's avatar
Hans Leidekker committed
397 398 399 400 401 402 403 404
    WORD wPriority;
    WORD wWeight;
    WORD wPort;
    WORD Pad;
} DNS_SRV_DATAA, *PDNS_SRV_DATAA;

typedef struct
{
405
    PWSTR pNameTarget;
Hans Leidekker's avatar
Hans Leidekker committed
406 407 408 409 410 411 412 413 414 415 416
    WORD wPriority;
    WORD wWeight;
    WORD wPort;
    WORD Pad;
} DNS_SRV_DATAW, *PDNS_SRV_DATAW;

DECL_WINELIB_TYPE_AW(DNS_SRV_DATA)
DECL_WINELIB_TYPE_AW(PDNS_SRV_DATA)

typedef struct
{
417
    PSTR pNameAlgorithm;
Hans Leidekker's avatar
Hans Leidekker committed
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
    PBYTE pAlgorithmPacket;
    PBYTE pKey;
    PBYTE pOtherData;
    DWORD dwCreateTime;
    DWORD dwExpireTime;
    WORD wMode;
    WORD wError;
    WORD wKeyLength;
    WORD wOtherLength;
    UCHAR cAlgNameLength;
    BOOL bPacketPointers;
} DNS_TKEY_DATAA, *PDNS_TKEY_DATAA;

typedef struct
{
433
    PWSTR pNameAlgorithm;
Hans Leidekker's avatar
Hans Leidekker committed
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
    PBYTE pAlgorithmPacket;
    PBYTE pKey;
    PBYTE pOtherData;
    DWORD dwCreateTime;
    DWORD dwExpireTime;
    WORD wMode;
    WORD wError;
    WORD wKeyLength;
    WORD wOtherLength;
    UCHAR cAlgNameLength;
    BOOL bPacketPointers;
} DNS_TKEY_DATAW, *PDNS_TKEY_DATAW;

DECL_WINELIB_TYPE_AW(DNS_TKEY_DATA)
DECL_WINELIB_TYPE_AW(PDNS_TKEY_DATA)

typedef struct
{
452
    PSTR pNameAlgorithm;
Hans Leidekker's avatar
Hans Leidekker committed
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
    PBYTE pAlgorithmPacket;
    PBYTE pSignature;
    PBYTE pOtherData;
    LONGLONG i64CreateTime;
    WORD wFudgeTime;
    WORD wOriginalXid;
    WORD wError;
    WORD wSigLength;
    WORD wOtherLength;
    UCHAR cAlgNameLength;
    BOOL bPacketPointers;
} DNS_TSIG_DATAA, *PDNS_TSIG_DATAA;

typedef struct
{
468
    PWSTR pNameAlgorithm;
Hans Leidekker's avatar
Hans Leidekker committed
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
    PBYTE pAlgorithmPacket;
    PBYTE pSignature;
    PBYTE pOtherData;
    LONGLONG i64CreateTime;
    WORD wFudgeTime;
    WORD wOriginalXid;
    WORD wError;
    WORD wSigLength;
    WORD wOtherLength;
    UCHAR cAlgNameLength;
    BOOL bPacketPointers;
} DNS_TSIG_DATAW, *PDNS_TSIG_DATAW;

typedef struct
{
    DWORD dwMappingFlag;
    DWORD dwLookupTimeout;
    DWORD dwCacheTimeout;
    DWORD cWinsServerCount;
    IP4_ADDRESS WinsServers[1];
} DNS_WINS_DATA, *PDNS_WINS_DATA;

typedef struct
{
    DWORD dwMappingFlag;
    DWORD dwLookupTimeout;
    DWORD dwCacheTimeout;
496
    PSTR pNameResultDomain;
Hans Leidekker's avatar
Hans Leidekker committed
497 498 499 500 501 502 503
} DNS_WINSR_DATAA, *PDNS_WINSR_DATAA;

typedef struct
{
    DWORD dwMappingFlag;
    DWORD dwLookupTimeout;
    DWORD dwCacheTimeout;
504
    PWSTR pNameResultDomain;
Hans Leidekker's avatar
Hans Leidekker committed
505 506 507 508 509 510 511 512
} DNS_WINSR_DATAW, *PDNS_WINSR_DATAW;

DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA)
DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA)

typedef struct _DnsRecordA
{
    struct _DnsRecordA *pNext;
513
    PSTR pName;
Hans Leidekker's avatar
Hans Leidekker committed
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
    WORD wType;
    WORD wDataLength;
    union
    {
        DWORD DW;
        DNS_RECORD_FLAGS S;
    } Flags;
    DWORD dwTtl;
    DWORD dwReserved;
    union
    {
        DNS_A_DATA A;
        DNS_SOA_DATAA SOA, Soa;
        DNS_PTR_DATAA PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
        DNS_MINFO_DATAA MINFO, Minfo, RP, Rp;
        DNS_MX_DATAA MX, Mx, AFSDB, Afsdb, RT, Rt;
        DNS_TXT_DATAA HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
        DNS_NULL_DATA Null;
        DNS_WKS_DATA WKS, Wks;
        DNS_AAAA_DATA AAAA;
        DNS_KEY_DATA KEY, Key;
        DNS_SIG_DATAA SIG, Sig;
        DNS_ATMA_DATA ATMA, Atma;
        DNS_NXT_DATAA NXT, Nxt;
        DNS_SRV_DATAA SRV, Srv;
        DNS_TKEY_DATAA TKEY, Tkey;
        DNS_TSIG_DATAA TSIG, Tsig;
        DNS_WINS_DATA WINS, Wins;
        DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
543
    } Data;
Hans Leidekker's avatar
Hans Leidekker committed
544 545 546 547 548
} DNS_RECORDA, *PDNS_RECORDA;

typedef struct _DnsRecordW
{
    struct _DnsRecordW *pNext;
549
    PWSTR pName;
Hans Leidekker's avatar
Hans Leidekker committed
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
    WORD wType;
    WORD wDataLength;
    union
    {
        DWORD DW;
        DNS_RECORD_FLAGS S;
    } Flags;
    DWORD dwTtl;
    DWORD dwReserved;
    union
    {
        DNS_A_DATA A;
        DNS_SOA_DATAW SOA, Soa;
        DNS_PTR_DATAW PTR, Ptr, NS, Ns, CNAME, Cname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
        DNS_MINFO_DATAW MINFO, Minfo, RP, Rp;
        DNS_MX_DATAW MX, Mx, AFSDB, Afsdb, RT, Rt;
        DNS_TXT_DATAW HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
        DNS_NULL_DATA Null;
        DNS_WKS_DATA WKS, Wks;
        DNS_AAAA_DATA AAAA;
        DNS_KEY_DATA KEY, Key;
        DNS_SIG_DATAW SIG, Sig;
        DNS_ATMA_DATA ATMA, Atma;
        DNS_NXT_DATAW NXT, Nxt;
        DNS_SRV_DATAW SRV, Srv;
        DNS_TKEY_DATAW TKEY, Tkey;
        DNS_TSIG_DATAW TSIG, Tsig;
        DNS_WINS_DATA WINS, Wins;
        DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
579
    } Data;
Hans Leidekker's avatar
Hans Leidekker committed
580 581
} DNS_RECORDW, *PDNS_RECORDW;

582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
#if defined(__WINESRC__) || defined(UNICODE)
typedef DNS_RECORDW DNS_RECORD;
typedef PDNS_RECORDW PDNS_RECORD;
#else
typedef DNS_RECORDA DNS_RECORD;
typedef PDNS_RECORDA PDNS_RECORD;
#endif

typedef struct _DnsRRSet
{
    PDNS_RECORD pFirstRR;
    PDNS_RECORD pLastRR;
} DNS_RRSET, *PDNS_RRSET;

#define DNS_RRSET_INIT( rrset )                          \
{                                                        \
    PDNS_RRSET  _prrset = &(rrset);                      \
    _prrset->pFirstRR = NULL;                            \
    _prrset->pLastRR = (PDNS_RECORD) &_prrset->pFirstRR; \
}

#define DNS_RRSET_ADD( rrset, pnewRR ) \
{                                      \
    PDNS_RRSET  _prrset = &(rrset);    \
    PDNS_RECORD _prrnew = (pnewRR);    \
    _prrset->pLastRR->pNext = _prrnew; \
    _prrset->pLastRR = _prrnew;        \
}

#define DNS_RRSET_TERMINATE( rrset ) \
{                                    \
    PDNS_RRSET  _prrset = &(rrset);  \
    _prrset->pLastRR->pNext = NULL;  \
}
Hans Leidekker's avatar
Hans Leidekker committed
616

617 618 619
DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE);
DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE);
#define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_)
Hans Leidekker's avatar
Hans Leidekker committed
620 621
DNS_STATUS WINAPI DnsExtractRecordsFromMessage_W(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDW*);
DNS_STATUS WINAPI DnsExtractRecordsFromMessage_UTF8(PDNS_MESSAGE_BUFFER,WORD,PDNS_RECORDA*);
622
VOID WINAPI DnsFree(PVOID,DNS_FREE_TYPE);
623 624 625
DNS_STATUS WINAPI DnsModifyRecordsInSet_A(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
DNS_STATUS WINAPI DnsModifyRecordsInSet_W(PDNS_RECORDW,PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
DNS_STATUS WINAPI DnsModifyRecordsInSet_UTF8(PDNS_RECORDA,PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
626 627 628 629
#define DnsModifyRecordsInSet WINELIB_NAME_AW(DnsModifyRecordsInSet_)
BOOL WINAPI DnsNameCompare_A(PCSTR,PCSTR);
BOOL WINAPI DnsNameCompare_W(PCWSTR,PCWSTR);
#define DnsNameCompare WINELIB_NAME_AW(DnsNameCompare_)
630 631 632
DNS_STATUS WINAPI DnsQuery_A(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
DNS_STATUS WINAPI DnsQuery_W(PCWSTR,WORD,DWORD,PVOID,PDNS_RECORDW*,PVOID*);
DNS_STATUS WINAPI DnsQuery_UTF8(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*);
633
#define DnsQuery WINELIB_NAME_AW(DnsQuery_)
634
DNS_STATUS WINAPI DnsQueryConfig(DNS_CONFIG_TYPE,DWORD,PCWSTR,PVOID,PVOID,PDWORD);
635 636
BOOL WINAPI DnsRecordCompare(PDNS_RECORD,PDNS_RECORD);
PDNS_RECORD WINAPI DnsRecordCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
637
VOID WINAPI DnsRecordListFree(PDNS_RECORD,DNS_FREE_TYPE);
638 639 640
BOOL WINAPI DnsRecordSetCompare(PDNS_RECORD,PDNS_RECORD,PDNS_RECORD*,PDNS_RECORD*);
PDNS_RECORD WINAPI DnsRecordSetCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET);
PDNS_RECORD WINAPI DnsRecordSetDetach(PDNS_RECORD);
Hans Leidekker's avatar
Hans Leidekker committed
641
void WINAPI DnsReleaseContextHandle(HANDLE);
642 643 644
DNS_STATUS WINAPI DnsReplaceRecordSetA(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
DNS_STATUS WINAPI DnsReplaceRecordSetW(PDNS_RECORDW,DWORD,HANDLE,PVOID,PVOID);
DNS_STATUS WINAPI DnsReplaceRecordSetUTF8(PDNS_RECORDA,DWORD,HANDLE,PVOID,PVOID);
645 646 647 648 649 650 651
#define DnsReplaceRecordSet WINELIB_NAME_AW(DnsReplaceRecordSet)
DNS_STATUS WINAPI DnsValidateName_A(PCSTR,DNS_NAME_FORMAT);
DNS_STATUS WINAPI DnsValidateName_W(PCWSTR, DNS_NAME_FORMAT);
DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT);
#define DnsValidateName WINELIB_NAME_AW(DnsValidateName_)
BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL);
BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL);
Hans Leidekker's avatar
Hans Leidekker committed
652 653 654 655 656 657

#ifdef __cplusplus
}
#endif

#endif