FwpsAllocateCloneNetBufferList0 (Compact 2013)
3/26/2014
This function allocates a clone NET_BUFFER_LIST structure of an existing NET_BUFFER_LIST structure.
Syntax
NTSTATUS NTAPI
FwpsAllocateCloneNetBufferList0(
IN OUT NET_BUFFER_LIST *originalNetBufferList,
IN NDIS_HANDLE netBufferListPoolHandle OPTIONAL,
IN NDIS_HANDLE netBufferPoolHandle OPTIONAL,
IN ULONG allocateCloneFlags,
OUT NET_BUFFER_LIST **netBufferList
);
Parameters
- originalNetBufferList
A pointer to the original NET_BUFFER_LIST structure that is being cloned
- 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.
- netBufferPoolHandle
A NET_BUFFER_LIST pool handle that was obtained from a previous call to the NdisAllocateNetBufferPool function. This parameter is optional and can be NULL.
- allocateCloneFlags
There are currently no flags defined for this function. Callout drivers should set this parameter to zero.
- netBufferList
A pointer to a variable which receives a pointer to the clone NET_BUFFER_LIST structure.
Return Value
The FwpsAllocateCloneNetBufferList0 function returns one of the following NTSTATUS codes:
Value |
Description |
---|---|
STATUS_SUCCESS |
The clone NET_BUFFER_LIST structure was successfully allocated |
Other status codes |
An error occurred |
Remarks
A callout driver calls the FwpsAllocateCloneNetBufferList0 function to allocate a clone NET_BUFFER_LIST structure of an existing NET_BUFFER_LIST structure.
This function is a wrapper around the NdisAllocateCloneNetBufferList function, but it is specialized for use by WFP packet injection functions.
If the clone NET_BUFFER_LIST structure should have attributes that are associated with a given pool, the callout driver must specify the pool handle in the NetBufferListPoolHandle or NetBufferPoolHandle parameter. If these parameters are NULL, the default pool pre-allocated 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 insert it into the network stack to replace the original NET_BUFFER_LIST structure by calling the packet injection functions. After the data described by the clone NET_BUFFER_LIST structure is successfully injected into the network stack, the callout driver should free 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.
Requirements
Header |
fwpsk.h |
See Also
Reference
Functions Called by Callout Drivers
NET_BUFFER_LIST
NdisAllocateNetBufferListPool
NdisAllocateCloneNetBufferList
NET_BUFFER_LIST_CONTEXT
NET_BUFFER
FwpsFreeCloneNetBufferList0
WFP Callout Driver Functions