NotifyIpInterfaceChange - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// netioapi.h

NETIOAPI_API NotifyIpInterfaceChange(
  _In_    ADDRESS_FAMILY               Family,
  _In_    PIPINTERFACE_CHANGE_CALLBACK Callback,
  _In_    PVOID                        CallerContext,
  _In_    BOOLEAN                      InitialNotification,
  _Inout_ HANDLE                       *NotificationHandle
);
View the official Windows hardware development documentation

NtDoc

No description available.

Windows hardware development documentation (notifyipinterfacechange)

NotifyIpInterfaceChange function

The NotifyIpInterfaceChange function registers the driver to be notified for changes to all IP interfaces, IPv4 interfaces, or IPv6 interfaces on a local computer.

Parameters

Return value

NotifyIpInterfaceChange returns STATUS_SUCCESS if the function succeeds.

If the function fails, NotifyIpInterfaceChange returns one of the following error codes:

Return code Description
ERROR_INVALID_HANDLE An internal error occurred where an invalid handle was encountered.
STATUS_INVALID_PARAMETER An invalid parameter was passed to the function. This error is returned if the Family parameter was not either AF_INET, AF_INET6, or AF_UNSPEC.
STATUS_NOT_ENOUGH_MEMORY There was insufficient memory.
Other Use the FormatMessage function to obtain the message string for the returned error.

Remarks

Your driver must set the Family parameter to either AF_INET, AF_INET6, or AF_UNSPEC.

The invocation of the callback function that is specified in the Callback parameter is serialized. The callback function should be defined as a function of type VOID. The parameters that are passed to the callback function include the following.

Parameter Description
IN PVOID CallerContext The CallerContext parameter that is passed to the NotifyIpInterfaceChange function when it is registering the driver for change notifications.
IN PMIB_IPINTERFACE_ROW Row OPTIONAL A pointer to the MIB_IPINTERFACE_ROW entry for the interface that was changed. This parameter is a NULL pointer when the MIB_NOTIFICATION_TYPE value that is passed in the NotificationType parameter to the callback function is set to MibInitialNotification. This situation can occur only if the InitialNotification parameter that is passed to NotifyIpInterfaceChange was set to TRUE when registering the driver for change notifications.
IN MIB_NOTIFICATION_TYPE NotificationType The notification type. This member can be one of the values from the MIB_NOTIFICATION_TYPE enumeration type.

To deregister the driver for change notifications, call the CancelMibChangeNotify2 function, passing the NotificationHandle parameter that NotifyIpInterfaceChange returns.

Requirements

Target platform Universal
Version Available in Windows Vista and later versions of the Windows operating systems.
Header Netioapi.h (include Netioapi.h)
Library Netio.lib
IRQL < DISPATCH_LEVEL

See also

CancelMibChangeNotify2

GetIfEntry2

GetIfStackTable

GetIfTable2

GetInvertedIfStackTable

GetIpInterfaceEntry

InitializeIpInterfaceEntry

MIB_IF_ROW2

MIB_IF_TABLE2

MIB_IPINTERFACE_ROW

MIB_NOTIFICATION_TYPE

SetIpInterfaceEntry