次の方法で共有


SetIfEntry (Compact 2013)

3/26/2014

This function is used to set the administrative status of an interface.

Syntax

DWORD SetIfEntry( 
  PMIB_IFROW pIfRow 
);

Parameters

  • pIfRow
    [in] Pointer to a MIB_IFROW structure. The dwIndex member of this structure should specify the interface on which to set administrative status. The dwAdminStatus member specifies the new administrative status. The following table shows the possible values for the dwAdminStatus member.

    Value

    Description

    MIB_IF_ADMIN_STATUS_UP

    The interface is administratively enabled.

    MIB_IF_ADMIN_STATUS_DOWN

    The interface is administratively disabled.

Return Value

Return code

Description

NO_ERROR

The function succeeds.

ERROR_ACCESS_DENIED

Access is denied.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function. This error is returned if a NULL pointer is passed in the pIfRow parameter, or the dwIndex member of the MIB_IFROW pointed to by the pIfRow parameter was unspecified.

ERROR_NOT_FOUND

The specified interface could not be found. This error is returned if the network interface specified by the dwIndex member of the MIB_IFROW structure pointed to by the pIfRow parameter could not be found.

Other

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

Remarks

The SetIfEntry function is used to set the administrative status of an interface on a local device.

The dwIndex member in the MIB_IFROW structure pointed to by the pIfRow parameter must be initialized to the interface index.

The SetIfEntry function will fail if the dwIndex member of the MIB_IFROW pointed to by the pIfRow parameter does not match an existing interface on the local device.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
GetIfTable
MIB_IFROW
MIB_IFTABLE
GetIfEntry

Other Resources

IP Helper