DhcpRemoveOptionV5 function (dhcpsapi.h)

The DhcpRemoveOptionV5 function removes the definition of a specific option for a specific user class and vendor class at the default option level on the DHCP server. This extends the functionality in DhcpRemoveOption with support for specific class and vendor names.

Syntax

DWORD DhcpRemoveOptionV5(
  [in] LPWSTR         ServerIpAddress,
  [in] DWORD          Flags,
  [in] DHCP_OPTION_ID OptionID,
  [in] LPWSTR         ClassName,
  [in] LPWSTR         VendorName
);

Parameters

[in] ServerIpAddress

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

[in] Flags

Specifies a bit flag that indicates whether or not the option is vendor-specific. If it is not, this parameter should be 0.

Value Meaning
0x00000000
This flag should be set if the option is removed for the default vendor class..
DHCP_FLAGS_OPTION_IS_VENDOR
0x00000003
This flag should be set if the option is removed for a specific vendor class..

[in] OptionID

DHCP_OPTION_ID value that specifies the code for the option to remove.

[in] ClassName

Unicode string that specifies the DHCP class name of the option. This parameter is optional.

[in] VendorName

Unicode string that specifies the vendor of the option. This parameter is optional, and should be NULL when Flags is not set to DHCP_FLAGS_OPTION_IS_VENDOR.

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_ACCESS_DENIED
This call was performed by a client who is not a member of the "DHCP Administrators" security group.
ERROR_DHCP_JET_ERROR
An error occurred while accessing the DHCP server's database.
ERROR_DHCP_OPTION_NOT_PRESENT
The specified option definition does not exist in the DHCP server database.
ERROR_DHCP_CLASS_NOT_FOUND
The supplied class name is either unknown or incorrect.

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

DhcpCreateOptionV5