DnsAcquireContextHandle_W function (windns.h)

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)

Syntax

DNS_STATUS DnsAcquireContextHandle_W(
  [in]           DWORD   CredentialFlags,
  [in, optional] PVOID   Credentials,
  [out]          PHANDLE pContext
);

Parameters

[in] CredentialFlags

A flag that indicates the character encoding. Set to TRUE for Unicode, FALSE for ANSI.

[in, optional] Credentials

A pointer to a SEC_WINNT_AUTH_IDENTITY_W structure or a SEC_WINNT_AUTH_IDENTITY_A structure that contains the name, domain, and password of the account to be used in a secure dynamic update. If CredentialFlags is set to TRUE, Credentials points to a SEC_WINNT_AUTH_IDENTITY_W structure; otherwise, Credentials points to a SEC_WINNT_AUTH_IDENTITY_A structure. If not specified, the credentials of the calling service are used. This parameter is optional.

[out] pContext

A pointer to a handle pointing to the returned credentials.

Return value

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

Requirements

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

See also

DNS_RECORD

DnsQuery

SEC_WINNT_AUTH_IDENTITY