3.2.4.42 R_DhcpSetServerBindingInfo (Opnum 41)

The R_DhcpSetServerBindingInfo method sets/modifies the IPv4 interface bindings for the DHCPv4 server.

 DWORD R_DhcpSetServerBindingInfo(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] ULONG Flags,
   [in, ref] LPDHCP_BIND_ELEMENT_ARRAY BindElementsInfo
 );

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

Flags: This flag is not used, and it MUST be set to 0.

BindElementsInfo: This is a pointer of type DHCP_BIND_ELEMENT_ARRAY (section 2.2.1.2.81) that points to the location that contains the information about the IPv4 interface binding.

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.

0x00004E52

ERROR_DHCP_NETWORK_CHANGED

The network has changed. Retry this operation after checking for the network changes. Network changes can be caused by interfaces that are new or no longer valid, or by IPv4 addresses that are new or no longer valid.

0x00004E53

ERROR_DHCP_CANNOT_MODIFY_BINDINGS

The bindings to internal IPv4 addresses cannot be modified.

The opnum field value for this method is 41.

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 Flags is not 0, or BindElementsInfo is NULL, or there are no entries in the server ADM element DHCPv4ServerBindingInfoList, return ERROR_INVALID_PARAMETER.

  • If the IPv4 interface binding specified in BindElementsInfo on the DHCPv4 server has the Flags field in the Elements set to DHCP_ENDPOINT_FLAG_CANT_MODIFY and the fBoundToDHCPServer field is set to FALSE, then return ERROR_DHCP_CANNOT_MODIFY_BINDINGS.

  • If the IPv4 interface binding specified in BindElementsInfo on the DHCPv4 server has the Flags field in the Elements set to DHCP_ENDPOINT_FLAG_CANT_MODIFY and the fBoundToDHCPServer field is set to TRUE, then skip all further checks on the binding and do not attempt to modify it. If all bindings are skipped, return ERROR_SUCCESS.

  • If no DHCPv4ServerBindingInfo object corresponding to the interface id specified in BindElementInfo is found in DHCPv4ServerBindingInfoList, return ERROR_DHCP_NETWORK_CHANGED.

  • Modify the matching DHCPv4ServerBindingInfo object with the value of fBoundToDHCPServer specified in BindElementsInfo.

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