INFO: AddIPAddress and DeleteIPAddress in IP Helper APIs

ID: Q199749


The information in this article applies to:


SUMMARY

As stated in the documentation of Microsoft Platform SDK for Windows NT 5.0 Beta 2 Edition, AddIPAddress() and DeleteIPAddress() of the IP Helper APIs are available on Windows NT 5.0 or later. However, these two APIs also work on Windows NT 4.0 with Service Pack 4 or later as long as the Routing and Remote Access Service is not running. If Routing and Remote Access Service is running on Windows NT 4.0 with Service Pack 4, AddIPAddress() and DeleteIPAddress() return ERROR_NOT_SUPPORT.


MORE INFORMATION

You can use the following steps to add or delete an IP address to an adapter interface:

  1. Use GetIfTable() to get the index of the adapter interface.


  2. Use AddIPAddress() to add your IP address to your interested interface index. A context number associated with this added entry is returned in one of the out parameters.


  3. Use DeleteIPAddress() and the returned context number to delete the added IP address entry.



However, it should be noted that you cannot use DeleteIPAddress to delete the original IP address assigned to an adapter interface under Windows NT 4.0 with Service Pack 4. This is because the context number associated with the original IP address can only be retrieved by GetAdaptersInfo API and this API is not supported on Windows NT 4.0.

Additional query words: IP Helper ERROR_NOT_SUPPORTED GetIfTable AddIPAddress DeleteIPAddress


Keywords          : kbNTOS400 kbSDKPlatform 
Version           : WINDOWS:; winnt:4.0
Platform          : WINDOWS winnt 
Issue type        : kbinfo 

Last Reviewed: March 10, 1999