3.2.4.44 R_DhcpSetDnsRegCredentials (Opnum 43)

The R_DhcpSetDnsRegCredentials method sets the DNS user name and credentials in the DHCP server which is used for DNS registrations for the DHCP client lease record.

 DWORD R_DhcpSetDnsRegCredentials(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, string, unique] LPWSTR Uname,
   [in, string, unique] LPWSTR Domain,
   [in, string, unique] LPWSTR Passwd
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

Uname: A pointer to a null-terminated Unicode string that contains the user name for the DNS credentials.

Domain: A pointer to a null-terminated Unicode string that contains the domain name for the DNS credentials.

Passwd: A pointer to a run-encoded, null-terminated Unicode string that contains the password for the DNS user name.<53>

Return Values: A 32-bit unsigned integer value that indicates return status. A return value ERROR_SUCCESS (0x00000000) indicates that the operation was completed successfully, else it contains a Win32 error code, as specified in [MS-ERREF]. This error code value can correspond to a DHCP-specific failure, which takes a value between 20000 and 20099, or any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

The opnum field value for this method is 43.

When processing this call, the DHCP server MUST do the following:

  • Validate if this method is authorized for read/write access per section 3.5.5. If not, return the error ERROR_ACCESS_DENIED.

  • Run-decode the Passwd parameter to convert it into the original clear-text form.<54>

  • Store the information provided in Uname, Domain, Passwd fields into the corresponding fields in the server ADM element DHCPServerDnsRegCredentials.

  • Remove the old DHCP-DNS registration, as specified by the [MSDN-FreeCredentialsHandle] function. If the removal succeeds, register the DHCP server credentials with DNS as specified by the [MSDN-AcquireCredentialsHandle] function. Return ERROR_SUCCESS, whether these registration APIs fail or succeed.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].