Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

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

C# Signature:

[DllImport("Iphlpapi.dll", EntryPoint = "PfCreateInterface")]

static extern Int32 PfCreateInterface(int dwName, PFFORWARD_ACTION inAction, PFFORWARD_ACTION outAction, int bUseLog, int bMustBeUnique, ref IntPtr ppInterface);

VB Signature:

Declare Function PfCreateInterface Lib "iphlpapi.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

//default action for this interface once created

enum PFFORWARD_ACTION : uint

{

     PF_ACTION_FORWARD = 0,
     PF_ACTION_DROP

}

Tips & Tricks:

Please add some!

Sample Code:

// C conversions for Fltdefs.h

internal const int FALSE = 0;

internal const int TRUE = 1;

IntPtr interfaceHandle = new IntPtr();

//create a filter interface in the tcp/ip stack

int result = PfCreateInterface(0, PFFORWARD_ACTION.PF_ACTION_FORWARD, PFFORWARD_ACTION.PF_ACTION_FORWARD, FALSE, TRUE, ref interfaceHandle);

//interfaceHandle can now be used to bind to a local ip address (PfBindInterfaceToIPAddress) which allow protocol specific packet filters to be added (PfAddFiltersToInterface)

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions