SetIpInterfaceEntry - NtDoc

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

NETIOAPI_API SetIpInterfaceEntry(
  _Inout_ PMIB_IPINTERFACE_ROW Row
);
View the official Windows hardware development documentation

NtDoc

No description available.

Windows hardware development documentation (setipinterfaceentry)

SetIpInterfaceEntry function

The SetIpInterfaceEntry function sets the properties of an IP interface on a local computer.

Parameters

Return value

SetIpInterfaceEntry returns STATUS_SUCCESS if the function succeeds.

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

Return code Description
STATUS_INVALID_PARAMETER An invalid parameter was passed to the function. This error is returned if a NULL pointer is passed in the Row parameter, the Family member of the MIB_IPINTERFACE_ROW structure that the Row parameter points to was not specified as AF_INET or AF_INET6, or both InterfaceLuid and InterfaceIndex members of the MIB_IPINTERFACE_ROW structure were unspecified.
STATUS_NOT_FOUND The specified interface could not be found. This error is returned if the function cannot find the network interface that is specified by the InterfaceLuid or InterfaceIndex member of the MIB_IPINTERFACE_ROW structure that the Row parameter points to.
Other Use the FormatMessage function to obtain the message string for the returned error.

Remarks

Your driver must use the InitializeIpInterfaceEntry function to initialize the fields of a MIB_IPINTERFACE_ROW structure entry with default values. A driver can then change the fields in the MIB_IPINTERFACE_ROW entry that it wants to modify, and then call the SetIpInterfaceEntry function.

On input, your driver must initialize the following members of the MIB_IPINTERFACE_ROW structure that the Row parameter points to.

On output, the InterfaceLuid member of the MIB_IPINTERFACE_ROW structure that the Row parameter points to is filled in if the InterfaceIndex was specified.

SetIpInterfaceEntry ignores the MaxReassemblySize, MinRouterAdvertisementInterval, MaxRouterAdvertisementInterval, Connected, SupportsWakeUpPatterns, SupportsNeighborDiscovery, SupportsRouterDiscovery, ReachableTime, TransmitOffload, and ReceiveOffload members of the MIB_IPINTERFACE_ROW structure that the Row parameter points to. These members are set by the network stack and cannot be changed by using the SetIpInterfaceEntry function.

Unprivileged simultaneous access to multiple networks of different security requirements creates a security hole and enables an unprivileged driver to accidentally relay data between the two networks. A typical example is simultaneous access to a virtual private network (VPN) and the Internet. The Windows Server 2003 and Windows XP operating systems use a weak host model, where Remote Access Service (RAS) prevents such simultaneous access by increasing the route metric of all default routes over other interfaces. Therefore, all traffic is routed through the VPN interface, disrupting other network connectivity.

On Windows Vista and later versions of the Windows operating systems, by default, a strong host model is used. If a source IP address is specified in the route lookup by using the GetBestRoute2 function, the route lookup is restricted to the interface of the source IP address. The route metric modification by RAS has no effect because the list of potential routes does not even have the route for the VPN interface, which enables traffic to the Internet. Your driver can use the DisableDefaultRoutes member of the MIB_IPINTERFACE_ROW structure to disable using the default route on an interface. VPN clients can use this member as a security measure to restrict split tunneling when split tunneling is not required by the VPN client. A VPN client can call the SetIpInterfaceEntry function to set the DisableDefaultRoutes member to TRUE when it is required. A VPN client can query the current state of the DisableDefaultRoutes member by calling the GetIpInterfaceEntry function.

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

GetBestRoute2

GetIfEntry2

GetIfTable2

GetIfTable2Ex

GetIpInterfaceEntry

GetIpInterfaceTable

InitializeIpInterfaceEntry

MIB_IF_ROW2

MIB_IF_TABLE2

MIB_IPINTERFACE_ROW

MIB_IPINTERFACE_TABLE

NotifyIpInterfaceChange