Platform SDK: Internet Protocol Helper |
The AddIPAddress function adds the specified IP address to the specified adapter.
DWORD AddIPAddress( IPAddr Address, // IP address to add IPMask IpMask, // subnet mask for IP address DWORD IfIndex, // index of adapter PULONG NTEContext, // Net Table Entry context PULONG NTEInstance // Net Table Entry Instance );
If the function succeeds, the return value is NO_ERROR.
If the function fails, use FormatMessage to obtain the message string for the returned error.
For information about the IPAddr and IPMask data types, see Win32 Simple Data Types. To convert an IP address between dotted decimal notation and IPAddr format, use the inet_addr and inet_ntoa functions.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Iphlpapi.h.
Library: Use Iphlpapi.lib.