Platform SDK: Network Management

DnsWriteQuestionToBuffer

The DnsWriteQuestionToBuffer function type creates a DNS query message and stores it in a DNS_MESSAGE_BUFFER structure. Like many DNS functions, the DnsWriteQuestionToBuffer function type is implemented in multiple forms to facilitate different character encoding. Based on the character encoding involved, use one of the following functions:

DnsWriteQuestionToBuffer_W (_W for Unicode encoding)

DnsWriteQuestionToBuffer_UTF8 (_UTF8 for UTF-8 encoding)

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

BOOL WINAPI DnsWriteQuestionToBuffer (
  PDNS_MESSAGE_BUFFER pDnsBuffer,
  LPDWORD pdwBufferSize,
  LPWSTR pszName,
  WORD wType,
  WORD Xid,
  BOOL fRecursionDesired
);

Parameters

pDnsBuffer
[in, out] Pointer to a DNS query message stored in a buffer.
pdwBufferSize
[in, out] Size of the buffer allocated to store the message, in bytes. If the buffer size is insufficient to contain the message, an error is returned and pdwBufferSize contains the minimum required buffer size.
pszName
[in] Name of the owner of the record set being queried.
wType
[in] Numeric representation of the type of record set queried.
Xid
[in] Query identifier.
fRecursionDesired
[in] Flag indicating the desired type of DNS name resolution. Set to TRUE to request recursive name resolution, FALSE to request iterative name resolution.

Return Values

Returns TRUE upon successful execution, otherwise returns FALSE.

Requirements

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

See Also

DnsQuery