PfTestPacket (iphlpapi)
Last changed: anonymous

.
Summary
The PfTestPacket function tests the specified packet and returns the action that would be performed given the specified interface.

C# Signature:

    [DllImport("iphlpapi.dll", EntryPoint = "PfTestPacket")]
    public static extern UInt32 PfTestPacket(IntPtr pInInterface, IntPtr pOutInterface, uint cBytes, IntPtr pbPacket, ref PFFORWARD_ACTION ppAction);

VB Signature:

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

User-Defined Types:

    internal enum PFFORWARD_ACTION : uint
    {
        PF_ACTION_FORWARD = 0,
        PF_ACTION_DROP
    }

Notes:

    /// <summary>
    /// The PfTestPacket function tests the specified packet and returns the action that would be performed given the specified interface.
    /// </summary>
    /// <param name="pInInterface">[in, optional] Handle to an interface to use as an input interface for the packet. This parameter is optional and may be NULL.</param>
    /// <param name="pOutInterface">[in, optional] Handle to an interface to use as an output interface for the packet. This parameter is optional and may be NULL.</param>
    /// <param name="cBytes">[in] Specifies the size, in bytes, of the test packet specified by the pbPacket parameter.</param>
    /// <param name="pbPacket">[in] Pointer to a network packet to test with the specified interface (or interfaces).</param>
    /// <param name="ppAction">[out] Pointer to a variable of type PFFORWARD_ACTION. This variable receives the action that would have been taken given the specified interface(s) and packet.</param>
    /// <returns>If the function succeeds, the return value is NO_ERROR.</returns>

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation