The FwpsAllocateCloneNetBufferList0 function allocates a NET_BUFFER_LIST structure that is a clone of an existing NET_BUFFER_LIST structure.
NTSTATUS FwpsAllocateCloneNetBufferList0( NET_BUFFER_LIST *originalNetBufferList, NDIS_HANDLE netBufferListPoolHandle, NDIS_HANDLE netBufferPoolHandle, ULONG allocateCloneFlags, NET_BUFFER_LIST **netBufferList );
A pointer to the original NET_BUFFER_LIST structure that is being cloned.
There are currently no flags defined for this function. Callout drivers should set this parameter to zero.
A pointer to a variable that receives a pointer to the clone NET_BUFFER_LIST structure.
The FwpsAllocateCloneNetBufferList0 function returns one of the following NTSTATUS codes.
||The clone NET_BUFFER_LIST structure was successfully allocated.|
||An error occurred.|
A callout driver calls the FwpsAllocateCloneNetBufferList0 function to allocate a clone NET_BUFFER_LIST structure of an existing NET_BUFFER_LIST structure.
If the clone NET_BUFFER_LIST structure should have attributes that are associated with a specific pool, the callout driver must specify the pool handle in the NetBufferListPoolHandle or NetBufferPoolHandle parameter. If these parameters are NULL, the default pool preallocated by NDIS is used.
The clone NET_BUFFER_LIST structure describes the same data that is described by the original NET_BUFFER_LIST structure. The FwpsAllocateCloneNetBufferList0 function does not copy the data that is described by the original MDLs to new data buffers. Instead, the clone NET_BUFFER_LIST structure references the original data buffers. The clone NET_BUFFER_LIST structure does not include an initial NET_BUFFER_LIST_CONTEXT structure.
This function sets the ParentNetBufferList member of the newly created clone NET_BUFFER_LIST structure to point to the parent NET_BUFFER_LIST structure. The parent structure's ChildRefCount member is incremented by 1.
A callout driver can modify the clone NET_BUFFER_LIST structure and inject it into the network stack in place of the original NET_BUFFER_LIST structure by calling the packet injection functions. After the data described by the clone NET_BUFFER_LIST structure has been successfully injected into the network stack, the callout driver frees the clone NET_BUFFER_LIST structure by calling the FwpsFreeCloneNetBufferList0 function.
A callout driver can insert or replace individual net buffers (NET_BUFFER) or MDLs inside the clone net buffer list. Such a driver must also undo the modifications before it calls the FwpsFreeCloneNetBufferList0 function.
The intended use for cloned packets in WFP is to get clarification from a user-mode application or other relatively fast operation. The callout driver must not hold cloned packets while, for example, waiting for user input, or waiting for web service clearance, or waiting for any other operation that might take an arbitrary amount of time.
If the callout driver needs to wait for a potentially lengthy operation, it makes a deep copy of the packet using FwpsAllocateNetBufferAndNetBufferList0, and it blocks and absorbs the original packet.
Callout drivers should always return held packets as quickly as possible.
|Minimum supported client||Available starting with Windows Vista.|
|Header||fwpsk.h (include Fwpsk.h)|