Platform SDK: Network Management

DnsExtractRecordsFromMessage

The DnsExtractRecordsFromMessage function type extracts resource records from a DNS message, and stores those records in a DNS_RECORD structure. Like many DNS functions, the DnsExtractRecordsFromMessage function type is implemented in multiple forms to facilitate different character encoding. Based on the character encoding involved, use one of the following functions:

DnsExtractRecordsFromMessage_W (_W for Unicode encoding)

DnsExtractRecordsFromMessage_UTF8 (_UTF8 for UTF-8 encoding)

If the DnsExtractRecordsFromMessage function type is called without its suffix (either _W or _UTF8), a compiler error will occur.

DNS_STATUS WINAPI DnsExtractRecordsFromMessage (
  PDNS_MESSAGE_BUFFER pDnsBuffer,
  WORD wMessageLength,
  PDNS_RECORD *ppRecord
);

Parameters

pDnsBuffer
[in] Pointer to a DNS response message stored in a DNS_MESSAGE_BUFFER structure.
wMessageLength
[in] Size of the message stored in DNS_MESSAGE_BUFFER, in bytes.
ppRecord
[in, out] Pointer to a pointer to the list of extracted resource records.

Return Values

Returns success confirmation upon successful completion. Otherwise, returns the appropriate DNS-specific error code as defined in Winerror.h.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Windns.h.
  Library: Use Dnsapi.lib.

See Also

DnsWriteQuestionToBuffer, DnsQuery