CancelMibChangeNotify2 function (netioapi.h)

The CancelMibChangeNotify2 function deregisters for change notifications for IP interface changes, IP address changes, IP route changes, Teredo port changes, and when the unicast IP address table is stable and can be retrieved.


  [in] HANDLE NotificationHandle


[in] NotificationHandle

The handle returned from a notification registration or retrieval function to indicate which notification to cancel.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Return code Description
An invalid parameter was passed to the function. This error is returned if the NotificationHandle parameter was a NULL pointer.
Use FormatMessage to obtain the message string for the returned error.


The CancelMibChangeNotify2 function is defined on Windows Vista and later.

CancelMibChangeNotify2 function deregisters for a change notification previously requested for IP interface changes, IP address changes, IP route changes, or Teredo port changes on a local computer. These requests are made by calling NotifyIpInterfaceChange, NotifyUnicastIpAddressChange, NotifyRouteChange2, or NotifyTeredoPortChange. The
CancelMibChangeNotify2 function also cancels a previous request to be notified when the unicast IP address table is stable on a local computer and can be retrieved. This request is made by calling the NotifyStableUnicastIpAddressTable function.

The NotificationHandle parameter returned to these notification functions is passed to CancelMibChangeNotify2 to deregister for notifications or cancel a pending request to retrieve the stable unicast IP address table.

An application cannot make a call to the CancelMibChangeNotify2 function from the context of the thread which is currently executing the notification callback function for the same NotificationHandle parameter. Otherwise, the thread executing that callback will result in deadlock. So the CancelMibChangeNotify2 function must not be called directly as part of the notification callback routine. In a more general situation, a thread that executes the CancelMibChangeNotify2 function cannot own a resource on which the thread that executes a notification callback operation would wait because it would result in a similar deadlock. The CancelMibChangeNotify2 function should be called from a different thread, on which the thread that receives the notification callback doesn’t have dependencies on.


Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header netioapi.h (include Iphlpapi.h)
Library Iphlpapi.lib
DLL Iphlpapi.dll

See also