3.2.4.46 R_DhcpRestoreDatabase (Opnum 45)

The R_DhcpRestoreDatabase method sets/modifies the restore path. The DHCP server uses this path to restore the configuration, settings, and DHCP client lease record the next time it is restarted.

 DWORD R_DhcpRestoreDatabase(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, string] LPWSTR Path
 );

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

Path: A pointer to a null-terminated Unicode string that contains the name of the new restore path where the registry configuration and the DHCP database are restored.

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.

0x00004E2D

ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server.

The opnum field value for this method is 45.

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.

  • If the Path is not from the standard backup path, back up the existing information stored in the ADM elements in the standard backup path so that it can be used if the restore for the new ADM elements fails.

  • Set the server ADM element DHCPServerRestorePath to the path from where the ADM elements are to be restored when the DHCP server starts again.

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