Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The DhcpV4RemoveOptionValue function removes an option value from a scope defined on the DHCP server. This function extends the functionality provided by DhcpRemoveOptionValueV5 by allowing the caller to specify a policy for the option.
Syntax
DWORD DHCP_API_FUNCTION DhcpV4RemoveOptionValue(
[in, optional] LPWSTR ServerIpAddress,
[in] DWORD Flags,
[in] DHCP_OPTION_ID OptionID,
[in, optional] LPWSTR PolicyName,
[in, optional] LPWSTR VendorName,
[in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo
);
Parameters
[in, optional] ServerIpAddress
Pointer to a null-terminated Unicode string that represents the IP address or hostname of the DHCP server.
[in] Flags
Indicates whether the option value is for a specific or default vendor.
Flags | Meaning |
---|---|
|
The option value is removed for a default vendor. |
|
The option value is removed for a specific vendor. The vendor is in VendorName. |
[in] OptionID
DHCP_OPTION_ID structure that specifies the option code for the option value to remove. A complete list of standard DHCP and BOOTP option codes can be found at http://www.ietf.org/rfc/rfc2132.txt
[in, optional] PolicyName
A null-terminated Unicode string that represents the name of the policy inside the subnet of the option value to remove. The subnet is identified by the SubnetScopeInfo member of ScopeInfo.
[in, optional] VendorName
A null-terminated Unicode string that represents the vendor of the option. This parameter is optional, and should be NULL when Flags is not DHCP_FLAGS_OPTION_IS_VENDOR. If the vendor is not specified, the option value is set for the default vendor.
[in] ScopeInfo
Pointer to a DHCP_OPTION_SCOPE_INFO structure that contains information on the scope of the option value to remove
Return value
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, it returns one of the following or an error code from DHCP Server Management API Error Codes.
Value | Meaning |
---|---|
|
One or more of the parameters were invalid. |
|
The class name being used is unknown or incorrect. |
|
The specified policy name does not exist. |
|
The specified option definition does not exist on the DHCP server database or there is no value set for the specified option ID on the specified policy. |
|
The specified IPv4 subnet does not exist. |
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |