FwpsCloneStreamData0 function (fwpsk.h)

The FwpsCloneStreamData0 function allocates a clone of an existing FWPS_STREAM_DATA0 data stream.

Note  FwpsCloneStreamData0 is a specific version of FwpsCloneStreamData. See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information.
 

Syntax

NTSTATUS FwpsCloneStreamData0(
  [in, out]      FWPS_STREAM_DATA0 *calloutStreamData,
  [in, optional] NDIS_HANDLE       netBufferListPoolHandle,
  [in, optional] NDIS_HANDLE       netBufferPoolHandle,
  [in]           ULONG             allocateCloneFlags,
  [out]          NET_BUFFER_LIST   **netBufferListChain
);

Parameters

[in, out] calloutStreamData

A pointer to the original FWPS_STREAM_DATA0 structure that is to have its NET_BUFFER_LIST structure cloned.

[in, optional] netBufferListPoolHandle

A NET_BUFFER_LIST pool handle that was obtained from a previous call to the NdisAllocateNetBufferListPool function. This parameter is optional and can be NULL.

[in, optional] netBufferPoolHandle

A NET_BUFFER pool handle that was obtained from a previous call to the NdisAllocateNetBufferPool function. This parameter is optional and can be NULL.

[in] allocateCloneFlags

There are currently no flags defined for this function. Callout drivers should set this parameter to zero.

[out] netBufferListChain

A pointer to a location that receives a pointer to a chain of NET_BUFFER_LIST structures that describe all of the cloned stream data.

Return value

The FwpsCloneStreamData0 function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The clone FWPS_STREAM_DATA0 structure was successfully allocated.
Other status codes
An error occurred.

Remarks

This cloned stream data can be injected by a callout driver into the TCP/IP network stack at a later time.

The FwpsCloneStreamData0 function clones the entire chain of NET_BUFFER_LIST structures contained in the existing FWPS_STREAM_DATA0 data stream. The function trims unused data such that a callout driver can successfully pass the cloned chain to the FwpsStreamInjectAsync0 function.

After stream data in the clone NET_BUFFER_LIST structure chain has been successfully injected into the network stack, the completionFn callout function is called for each clone NET_BUFFER_LIST structure, and a callout should call FwpsFreeCloneNetBufferList0 to free the clone NET_BUFFER_LIST structure.

A callout should call the FwpsDiscardClonedStreamData0 function if the cloned stream data is to be discarded without being reinjected.

Requirements

Requirement Value
Minimum supported client Available starting with Windows Vista.
Target Platform Universal
Header fwpsk.h (include Fwpsk.h)
Library Fwpkclnt.lib
IRQL <= DISPATCH_LEVEL

See also

FWPS_STREAM_DATA0

FwpsDiscardClonedStreamData0

FwpsFreeCloneNetBufferList0

FwpsStreamInjectAsync0

NET_BUFFER

NET_BUFFER_LIST