PfCreateInterface

[PfCreateInterface is available for use in the operating systems listed in the Requirements section. In Windows Server "Longhorn", this function returns ERROR_CALL_NOT_SUPPORTED. The MprConfigInterfaceTransportSetInfo function and the Windows Filtering Platform API Management Functions provide similar functionality.]

The PfCreateInterface function creates a new filter interface. Use this interface to control the adding and deleting of filters to and from adapters.

DWORD PfCreateInterface(
  DWORD dwName,
  PFFORWARD_ACTION inAction,
  PFFORWARD_ACTION outAction,
  BOOL bUseLog,
  BOOL bMustBeUnique,
  INTERFACE_HANDLE* ppInterface
);

Parameters

  • dwName
    [in] Specifies the interface name. A zero value specifies a new, unique interface. Any other value is a potentially shared interface.

    The bMustBeUnique parameter can turn a shared interface into a unique one. However, using bMustBeUnique in this way can cause the function to fail.

  • inAction
    [in] Specifies a default action for an input packet. This member can be one of the following values.

    Value Meaning
    PF_ACTION_FORWARD Forward the packet.
    PF_ACTION_DROP Discard the packet.
  • outAction
    [in] Specifies a default action for an output packet. This member can be one of the following values.

    Value Meaning
    PF_ACTION_FORWARD Forward the packet.
    PF_ACTION_DROP Discard the packet.
  • bUseLog
    [in] Specifies whether to bind the log to this interface. If this member is TRUE, the log is bound to this interface.

  • bMustBeUnique
    [in] Specifies whether the interface is unique or shared. If this member is TRUE, this interface is unique, that is, it cannot be shared.

  • ppInterface
    [out] Pointer to a pointer that, on successful return, points to an interface handle to use with subsequent function calls.

Return Value

If the function succeeds, the return value is NO_ERROR.

If the function fails, use FormatMessage to obtain the message string for the returned error.

Remarks

An interface can either be unique to a process or shared. If an interface is shared, other processes may add or remove filters.

Requirements

Server Requires Windows Server 2003 or Windows 2000 Server.
Header

Declared in Fltdefs.h.

Library

Use Iphlpapi.lib.

DLL Requires Iphlpapi.dll.

See Also

PfAddFiltersToInterface
PfRemoveFiltersFromInterface
PfDeleteInterface