Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DnsCancelQuery

DnsCancelQuery function

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

Syntax


DNS_STATUS WINAPI DnsCancelQuery(
  _In_ PDNS_QUERY_CANCEL pCancelHandle
);

Parameters

pCancelHandle [in]

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

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Windns.h

Library

Dnsapi.lib

DLL

Dnsapi.dll

See also

DnsQuery
DnsQueryEx
DNS_QUERY_COMPLETION_ROUTINE
DNS_QUERY_RESULT
DNS_QUERY_REQUEST

 

 

Community Additions

ADD
Show:
© 2015 Microsoft