Partager via


IpRenewAddress (Compact 2013)

3/26/2014

This function renews a lease on an IP address previously obtained through DHCP.

Syntax

DWORD IpRenewAddress(
  PIP_ADAPTER_INDEX_MAP AdapterInfo 
);

Parameters

  • AdapterInfo
    [in] Pointer to an IP_ADAPTER_INDEX_MAP structure that identifies the adapter that is associated with the IP address to be renewed.

Return Value

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

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 renewal of the IPv4 address.

Other

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

Remarks

The IpRenewAddress function is specific to IPv4 and renews 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 renew.

An array of IP_ADAPTER_INDEX_MAP structures are 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 IpRenewAddress function returns ERROR_INVALID_PARAMETER.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
GetInterfaceInfo
IpReleaseAddress
IP_ADAPTER_INDEX_MAP
IP_INTERFACE_INFO

Other Resources

IP Helper