Knowledge Base

INFO: AddIPAddress and DeleteIPAddress in IP Helper APIs

PSS ID Number: 199749

Article Last Modified on 8/10/2001


The information in this article applies to:


This article was previously published under Q199749

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: kbinfo KB199749
Technology: kbAudDeveloper kbSDKSearch kbWin32SDKSearch kbWin32sSearch kbWinNT400search kbWinNTS400 kbWinNTS400search kbWinNTsearch kbWinNTSsearch kbWinNTW400 kbWinNTW400search kbWinNTWsearch