DnsAcquireContextHandle Function

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

C++
DNS_STATUS WINAPI DnsAcquireContextHandle(
  __in      DWORD CredentialFlags,
  __in_opt  PVOID Credentials,
  __out     PHANDLE pContext
);

Parameters

CredentialFlags [in]

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

Credentials [in, optional]

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.

pContext [out]

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

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWindns.h
LibraryDnsapi.lib
DLLDnsapi.dll
Unicode and ANSI namesDnsAcquireContextHandle_W (Unicode) and DnsAcquireContextHandle_A (ANSI)

See Also

DnsQuery
SEC_WINNT_AUTH_IDENTITY
DNS_RECORD

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Page view tracker