// fwpsk.h
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
);
View the official Windows Driver Kit DDI referenceNo description available.
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.
calloutStreamData [in, out]A pointer to the original FWPS_STREAM_DATA0 structure that is to have its NET_BUFFER_LIST structure cloned.
netBufferListPoolHandle [in, optional]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.
netBufferPoolHandle [in, optional]A NET_BUFFER pool handle that was obtained from a previous call to the NdisAllocateNetBufferPool function. This parameter is optional and can be NULL.
allocateCloneFlags [in]There are currently no flags defined for this function. Callout drivers should set this parameter to zero.
netBufferListChain [out]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.
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. |
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.