Platform SDK: Network Management

DnsAcquireContextHandle

The DnsAcquireContextHandle function type acquires a context handle to a set of credentials. Like many DNS functions, the DnsAcquireContextHandle function type is implemented in multiple forms to facilitate different character encoding. Based on the character encoding involved, use one of the following functions:

DnsAcquireContextHandle_A (_A for ANSI encoding)

DnsAcquireContextHandle_W (_W for Unicode encoding)

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

DNS_STATUS WINAPI DnsAcquireContextHandle(
  DWORD CredentialFlags,
  PVOID Credentials, 
  HANDLE *ContextHandle
);

Parameters

CredentialFlags
[in] Flag indicating character encoding. Set to TRUE for Unicode, FALSE for ANSI.
Credentials
[in, optional] Pointer to the SEC_WINNT_AUTH_IDENTITY_W structure or the SEC_WINNT_AUTH_IDENTITY_A structure containing the name, domain, and password of the account to be used in a secure dynamic update. If not specified, the credentials of the calling service are used. This parameter is optional.
ContextHandle
[out] Pointer to a handle pointing to the credentials.

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

DnsQuery