DnsCancelQuery function (windns.h)

The DnsCancelQuery function can be used to cancel a pending query to the DNS namespace.

Syntax

DNS_STATUS DnsCancelQuery(
  [in] PDNS_QUERY_CANCEL pCancelHandle
);

Parameters

[in] pCancelHandle

A pointer to a DNS_QUERY_CANCEL structure used to cancel an asynchronous DNS query. The structure must have been returned in the pCancelHandle parameter of a previous call to DnsQueryEx.

Return value

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

Remarks

DnsCancelQuery does not wait for a query to complete before cancelling. Therefore, applications should track pending queries through their DNS_QUERY_COMPLETION_ROUTINE DNS callbacks.

pCancelHandle is valid until the DNS_QUERY_COMPLETION_ROUTINE DNS callback is invoked and DnsCancelQuery completes.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header windns.h
Library Dnsapi.lib
DLL Dnsapi.dll

See also

DNS_QUERY_COMPLETION_ROUTINE

DNS_QUERY_REQUEST

DNS_QUERY_RESULT

DnsQuery

DnsQueryEx