DhcpServerQueryDnsRegCredentials function (dhcpsapi.h)

The DhcpServerQueryDnsRegCredentials function retrieves the current Domain Name System (DNS) credentials used by the DHCP server for client dynamic DNS registration.

Syntax

DWORD DhcpServerQueryDnsRegCredentials(
  [in]  LPWSTR ServerIpAddress,
  [in]  ULONG  UnameSize,
  [out] LPWSTR Uname,
  [in]  ULONG  DomainSize,
  [out] LPWSTR Domain
);

Parameters

[in] ServerIpAddress

DHCP_SRV_HANDLE that specifies the RPC binding to the DHCP server that will be queried.

[in] UnameSize

Unsigned 32-bit integer that indicates the size, in bytes, to allocate for the data returned in the Uname buffer.

[out] Uname

Pointer to a null-terminated Unicode string that contains the user name for the DNS server credentials. The size of this value cannot be larger than the size specified in UnameSize.

[in] DomainSize

Unsigned 32-bit integer that indicates the size, in bytes, to allocate for the data returned in the Domain buffer.

[out] Domain

Pointer to a null-terminated Unicode string that contains the domain name for the DNS server credentials. The size of this value cannot be larger than the size specified in DomainSize.

Return value

This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Remarks

DNS credentials can be set on the DHCP server by calling the DhcpServerSetDnsRegCredentialsV5 function.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header dhcpsapi.h
Library Dhcpsapi.lib
DLL Dhcpsapi.dll

See also

DhcpServerSetDnsRegCredentialsV5