3.2.4.8 R_DhcpDeleteMScope (Opnum 7)

The R_DhcpDeleteMScope method deletes the multicast subnet from the MADCAP server. The ForceFlag defines the behavior of the operation when the subnet has served a MADCAP client.

 DWORD R_DhcpDeleteMScope(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, ref, string] LPWSTR* MScopeName,
   [in] DHCP_FORCE_FLAG ForceFlag
 );

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

MScopeName: This is a pointer to a Unicode string that contains the name of the multicast subnet that needs to be removed. There is no restriction on the length of this field.

ForceFlag: This is of type DHCP_FORCE_FLAG (section 2.2.1.1.9) that defines the behavior of this method. If the flag is set to DhcpNoForce and this subnet has served the IPv4 address to some MADCAP clients, the IPv4 multicast subnet is not deleted. If the flag is set to DhcpFullForce, the IPv4 multicast subnet is deleted along with the MADCAP client's record on the MADCAP server.

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.

0x00004E27

ERROR_DHCP_ELEMENT_CANT_REMOVE

The specified IPv4 multicast scope cannot be removed because at least one multicast IPv4 address has been leased out to some MADCAP client.

0x00004E2D

ERROR_DHCP_JET_ERROR

An error occurred while accessing the MADCAP server database.

The opnum field value for this method is 7.

When processing this call, the MADCAP 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.

  • Retrieve the DHCPv4MScope ADM element entry corresponding to MScopeName from the server ADM element DHCPv4MScopesList.

  • If the DHCPv4MScope entry is not found, return ERROR_DHCP_SUBNET_NOT_PRESENT.

  • If the DHCPv4MClientsList ADM element of the retrieved DHCPv4MScope entry is not an empty list and ForceFlag is set to DhcpNoForce, return the error ERROR_DHCP_ELEMENT_CANT_REMOVE, else do the following:

    • Delete the DHCPv4MScope entry from the DHCPv4MScopesList.

    • Delete all the fields of the DHCPv4MScope entry (DHCPv4IpRangesList, DHCPv4IpExclusionRangesList, DHCPv4MClientsList, and DHCPv4MScopeOptValuesList).

  • Return ERROR_SUCCESS.

Exceptions Thrown: No exceptions SHOULD be thrown beyond those thrown by the underlying RPC protocol specified in [MS-RPCE].