次の方法で共有


IpReleaseAddress (Compact 2013)

3/26/2014

This function releases an IP address previously obtained through DHCP.

Syntax

DWORD IpReleaseAddress(
  PIP_ADAPTER_INDEX_MAP AdapterInfo 
);

Parameters

  • AdapterInfo
    [in] Pointer to an IP_ADAPTER_INDEX_MAP structure that contains information about the adapter associated with the IP address to release.

Return Value

Return code

Description

NO_ERROR

The function succeeds.

ERROR_INVALID_PARAMETER

One of the parameters is invalid. This error is returned if the AdapterInfo parameter is NULL or if the Name member of the PIP_ADAPTER_INDEX_MAP structure pointed to by the AdapterInfo parameter is invalid.

ERROR_PROC_NOT_FOUND

An exception occurred during the request to DHCP for the release of the IPv4 address.

Other

Use FormatMessage to obtain the message string for the returned error.

Remarks

The IpReleaseAddress function is specific to IPv4 and releases only an IPv4 address previously obtained through the Dynamic Host Configuration Protocol (DHCP). The Name member of the IP_ADAPTER_INDEX_MAP structure pointed to by the AdapterInfo parameter is the only member used to determine the DHCP address to release.

An array of IP_ADAPTER_INDEX_MAP structures is returned in the IP_INTERFACE_INFO structure by the GetInterfaceInfo function. The IP_INTERFACE_INFO structure returned by GetInterfaceInfo contains at least one IP_ADAPTER_INDEX_MAP structure even if the NumAdapters member of the IP_INTERFACE_INFO structure indicates that no network adapters with IPv4 are enabled. When the NumAdapters member of the IP_INTERFACE_INFO structure returned by GetInterfaceInfo is zero, the value of the members of the single IP_ADAPTER_INDEX_MAP structure returned in the IP_INTERFACE_INFO structure is undefined.

If the Name member of the IP_ADAPTER_INDEX_MAP structure pointed to by the AdapterInfo parameter is NULL, the IpReleaseAddress function returns ERROR_INVALID_PARAMETER.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
GetInterfaceInfo
IpRenewAddress
IpRenewAddress
IP_ADAPTER_INDEX_MAP
IP_INTERFACE_INFO

Other Resources

IP Helper