GetIpInterfaceEntry (Compact 2013)

3/26/2014

This function retrieves IP information for the specified interface on the local device.

Syntax

NETIOAPI_API GetIpInterfaceEntry(
  __inout  PMIB_IPINTERFACE_ROW Row
);

Parameters

  • Row
    A pointer to a MIB_IPINTERFACE_ROW structure that, on successful return, receives information for an interface on the local device. On input, the InterfaceLuid or InterfaceIndex member of the MIB_IPINTERFACE_ROW must be set to the interface for which to retrieve information.

Return Value

Return code

Description

NO_ERROR

The function succeeds.

ERROR_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 pointed to by the Row parameter was not specified as AF_INET or AF_INET6, or both the InterfaceLuid or InterfaceIndex members of the MIB_IPINTERFACE_ROW pointed to by the Row parameter were unspecified.

ERROR_NOT_FOUND

The specified interface could not be found. This error is returned if the network interface specified by the InterfaceLuid or InterfaceIndex member of the MIB_IPINTERFACE_ROW pointed to by the Row parameter could not be found.

Other

Use the FormatMessage function to obtain the message string for the returned error.

Remarks

On input, the Family member in the MIB_IPINTERFACE_ROW structure pointed to by the Row parameter must be initialized to either AF_INET or AF_INET6. In addition on input, at least one of the following members in the MIB_IPINTERFACE_ROW structure pointed to the Row parameter must be initialized: the InterfaceLuid or InterfaceIndex. The fields are used in the order listed earlier. So if the InterfaceLuid is specified, this member is used to determine the interface. If no value was set for the InterfaceLuid member (the values of this member was set to zero), the InterfaceIndex member is next used to determine the interface.

On output, the InterfaceLuid member of the MIB_IPINTERFACE_ROW structure pointed to by the Row parameter is filled in if the InterfaceIndex was specified. The other members of MIB_IPINTERFACE_ROW structure pointed to by the Row parameter are also filled in.

The InitializeIpInterfaceEntry function must be used to initialize the fields of a MIB_IPINTERFACE_ROW structure entry with default values. An application can then change the fields in the MIB_IPINTERFACE_ROW entry it wishes to modify, and then call the SetIpInterfaceEntry function.

Unprivileged concurrent access to multiple networks of different security requirements creates a security hole and allows an unprivileged application to accidentally relay data between the two networks. A typical example is concurrent access to a virtual private network (VPN) and the Internet.

See Also

Reference

IP Helper Functions
GetBestRoute
GetBestRoute2
GetIfEntry2
GetIfTable2
GetIfTable2Ex
GetIpInterfaceTable
MIB_IF_ROW2
MIB_IF_TABLE2
MIB_IPINTERFACE_ROW
MIB_IPINTERFACE_TABLE
SetIpInterfaceEntry

Other Resources

IP Helper