DhcpRemoveOptionValue function (dhcpsapi.h)

The DhcpRemoveOptionValue function removes the option value for a specific option on the DHCP4 server for the default user class and vendor class, for the specified scope.

Syntax

DWORD DHCP_API_FUNCTION DhcpRemoveOptionValue(
  [in] DHCP_CONST WCHAR                  *ServerIpAddress,
  [in] DHCP_OPTION_ID                    OptionID,
  [in] DHCP_CONST DHCP_OPTION_SCOPE_INFO *ScopeInfo
);

Parameters

[in] ServerIpAddress

Unicode string that specifies the IP address or hostname of the DHCP server.

[in] OptionID

DHCP_OPTION_ID value that contains the code uniquely identifying the specific option to remove from the DHCP server.

[in] ScopeInfo

DHCP_OPTION_SCOPE_INFO structure that contains information describing the specific scope (default, server, scope, or IPv4 reservation level) from which to remove the option value.

Return value

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

Return code Description
ERROR_DHCP_JET_ERROR
An error occurred while accessing the DHCP server database.
ERROR_DHCP_OPTION_NOT_PRESENT
The specified option definition could not be found in the DHCP server database.
ERROR_DHCP_SUBNET_NOT_PRESENT
The specified IPv4 subnet is not defined on the DHCP server.
ERROR_DHCP_NOT_RESERVED_CLIENT
The specified DHCP client is not a reserved client.

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

DHCP_OPTION_SCOPE_INFO

DhcpRemoveOptionValueV5

DhcpSetOptionValue