3.2.4.24 R_DhcpRemoveOptionValueV5 (Opnum 23)
The R_DhcpRemoveOptionValueV5 method removes the option value for a specific option on the DHCPv4 server for a specific user class and vendor class. If the user class or the vendor class is not specified, the option value is removed from the default user class or vendor class. ScopeInfo defines the scope on which this option value is removed.
-
DWORD R_DhcpRemoveOptionValueV5( [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress, [in] DWORD Flags, [in] DHCP_OPTION_ID OptionID, [in, string, unique] WCHAR* ClassName, [in, string, unique] WCHAR* VendorName, [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo );
ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.
Flags: This is of type DWORD, specifying that the option values are removed for a specific or default vendor class.
-
Value
Meaning
DHCP_FLAGS_OPTION_DEFAULT
0x00000000
Option value is removed for a default vendor class.
DHCP_FLAGS_OPTION_IS_VENDOR
0x00000003
If a bitwise AND operation with this bitmask yields a nonzero value, it indicates that the option value is removed for a specific vendor class.
OptionID: This is of type DHCP_OPTION_ID (section 2.2.1.2.3), containing the option identifier for the option being removed.
ClassName: A pointer to a null-terminated Unicode string that contains the name of the user class from which the option value is being removed. This parameter is optional. If ClassName is not specified, implementations MUST retrieve the option value for the default user class.
VendorName: A pointer to a null-terminated Unicode string that contains the name of the vendor class to which the option value is being removed. This parameter is optional, and if a vendor class is not specified, the option value is removed for the default vendor class.
ScopeInfo: This is a pointer to a DHCP_OPTION_SCOPE_INFO (section 2.2.1.2.41) structure that contains information describing the DHCPv4 scope this option value is removed on. This value defines that option as being removed from the server, multicast scope, or scope level or from an IPv4 reservation.
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.
0x00004E25
ERROR_DHCP_SUBNET_NOT_PRESENT
The specified IPv4 subnet does not exist on the DHCP server.
0x00004E2A
ERROR_DHCP_OPTION_NOT_PRESENT
The specified option definition does not exist on the DHCP server database.
0x00004E32
ERROR_DHCP_NOT_RESERVED_CLIENT
The specified DHCP client is not a reserved client.
0x00004E4C
ERROR_DHCP_CLASS_NOT_FOUND
The class name being used is unknown or incorrect.
The opnum field value for this method is 23.
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.
The Flags parameter MUST pass one of the validations given in the Flags field description. Otherwise, the method returns ERROR_INVALID_PARAMETER.
If ScopeInfo contains DhcpDefaultOptions, return the error ERROR_INVALID_PARAMETER.
If ScopeInfo contains DhcpGlobalOptions, iterate through the server ADM element DHCPv4OptionDefList and retrieve DHCPv4OptionDef.DHCPv4ClassedOptDefList corresponding to the user class and vendor class specified by ClassName and VendorName respectively. If ClassName or VendorName is NULL, implementations MUST use the default user class or vendor class respectively (see section 3.1.1.9). If there is no DHCPv4OptionDef entry corresponding to specified user and vendor classes, return ERROR_DHCP_CLASS_NOT_FOUND. Otherwise, go to the last step.
If ScopeInfo contains DhcpSubnetOptions, retrieve the DHCPv4Scope entry corresponding to the field SubnetScopeInfo of ScopeInfo from the server ADM element DHCPv4ScopesList. If the DHCPv4Scope entry is not found, return ERROR_DHCP_SUBNET_NOT_PRESENT, else iterate through DHCPv4Scope.DHCPv4ScopeOptValuesList and retrieve the DHCPv4OptionValue corresponding to the user class and vendor class specified by ClassName and VendorName, respectively. If ClassName or VendorName is NULL, implementations MUST use the default user class or vendor class respectively (see section 3.1.1.9). If the DHCPv4OptionValue element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve the DHCPv4ClassedOptValue entry corresponding to OptionID from DHCPv4OptionValue.DHCPv4ClassedOptValueList. Go to the last step.
If ScopeInfo contains DhcpMScopeOptions, retrieve the DHCPv4MScope entry corresponding to the ScopeInfo parameter from the server ADM element DHCPv4MScopesList. If the DHCPv4MScope object is not found, return ERROR_DHCP_SUBNET_NOT_PRESENT, else iterate through DHCPv4MScope.DHCPv4MScopeOptValuesList and retrieve the DHCPv4OptionValue corresponding to the user class and vendor class specified by ClassName and VendorName, respectively. If ClassName or VendorName is NULL, implementations MUST use the default user class or vendor class respectively (see section 3.1.1.9). If the DHCPv4OptionValue element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve the DHCPv4ClassedOptValue entry corresponding to OptionID from DHCPv4OptionValue.DHCPv4ClassedOptValueList. Go to the last step.
If ScopeInfo contains DhcpReservedOptions, retrieve the DHCPv4Scope object from the server ADM element DHCPv4ScopesList that contains the ReservedIpAddress field of the ScopeInfo parameter. Otherwise, if the DHCPv4Scope entry is not found, return ERROR_DHCP_NOT_RESERVED_CLIENT, else if the ScopeInfo.SubnetAddress does not match ScopeInfo's ReservedIpSubnetAddress field, return ERROR_DHCP_SUBNET_NOT_PRESENT, else retrieve the DHCPv4Reservation entry from DHCPv4Scope.DHCPv4ReservationsList corresponding to ReservedIpAddress. If ReservedIpAddress is not part of any of DHCPv4Scope, or if there is no DHCPv4Reservation corresponding to ReservedIpAddress, return ERROR_DHCP_NOT_RESERVED_CLIENT, else iterate through DHCPv4Reservation.DHCPv4ResvOptValuesList and retrieve DHCPv4OptionValue corresponding to the user and vendor class specified by ClassName and VendorName, respectively. If ClassName or VendorName is NULL, implementations MUST use the default user class or vendor class respectively (see section 3.1.1.9). If the DHCPv4OptionValue element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve the DHCPv4ClassedOptValue entry corresponding to OptionID from DHCPv4OptionValue.DHCPv4ClassedOptValueList.
If the DHCPv4ClassedOptValue entry is not present, return ERROR_DHCP_OPTION_NOT_PRESENT. If the Flags parameter indicates a default option but VendorName contains a valid value, or if the Flags parameter indicates a vendor option but the VendorName parameter is set to NULL, return ERROR_DHCP_OPTION_NOT_PRESENT. Otherwise, delete the DHCPv4ClassedOptValue entry corresponding to the OptionID from DHCPv4ClassedOptValueList and return ERROR_SUCCESS.<48>
Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].