3.2.4.88 R_DhcpSetDnsRegCredentialsV5 (Opnum 87)

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

 DWORD R_DhcpSetDnsRegCredentialsV5 (
     [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 null-terminated Unicode string that contains the password for the DNS user name.

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 87.

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

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

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

  • The caller of this method need not encode the password.

  • 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].