Share via


FwpsAllocateNetBufferAndNetBufferList0 (Compact 2013)

3/26/2014

This function allocates a new NET_BUFFER_LIST structure.

Syntax

NTSTATUS NTAPI
  FwpsAllocateNetBufferAndNetBufferList0(
    IN NDIS_HANDLE  poolHandle,
    IN USHORT  contextSize,
    IN USHORT  contextBackFill,
    IN OPTIONAL MDL  *mdlChain,
    IN ULONG  dataOffset,
    IN SIZE_T  dataLength,
    OUT NET_BUFFER_LIST  **netBufferList
    );

Parameters

  • contextSize
    The size, in bytes, of used data space in the NET_BUFFER_LIST_CONTEXT structure to reserve for the callout driver. The value of this parameter must be a multiple of the value that is defined by MEMORY_ALLOCATION_ALIGNMENT.
  • contextBackFill
    The size, in bytes, of unused data space (backfill space) that the callout driver requires. The FwpsAllocateNetBufferAndNetBufferList0 function adds this value to the value specified in the contextSize parameter and allocates additional space. The value of this parameter must be a multiple of the value that is defined by MEMORY_ALLOCATION_ALIGNMENT.
  • mdlChain
    A pointer to an MDL chain that is used to initialize the preallocated NET_BUFFER structure. This parameter is optional and can be NULL.
  • dataOffset
    The initial offset, in bytes, from the start of the buffer to the start of the used data space in the MDL chain. Data space ahead of this offset is unused data space. Therefore, this value also represents the initial amount of available backfill space in the MDL chain.
  • dataLength
    The length, in bytes, of the used data space in the MDL chain.
  • netBufferList
    A pointer to a variable which receives a pointer to the new NET_BUFFER_LIST structure.

Return Value

The FwpsAllocateCloneNetBufferList0 function returns one of the following NTSTATUS codes:

Value

Description

STATUS_SUCCESS

The new NET_BUFFER_LIST structure was successfully allocated

Other status codes

An error occurred

Remarks

A callout driver calls the FwpsAllocateNetBufferAndNetBufferList0 function to allocate a new NET_BUFFER_LIST structure.

This function is a wrapper around the NdisAllocateNetBufferAndNetBufferList function. However, it is specialized for use by WFP packet injection functions.

After the data described by the new NET_BUFFER_LIST structure has been successfully injected into the network stack, the callout driver should free the new NET_BUFFER_LIST structure by calling the FwpsFreeNetBufferList0 function.

Requirements

Header

fwpsk.h

See Also

Reference

Functions Called by Callout Drivers
NET_BUFFER_LIST
NdisAllocateNetBufferListPool
NET_BUFFER_LIST_CONTEXT
NET_BUFFER
NdisAllocateNetBufferAndNetBufferList
FwpsFreeNetBufferList0
WFP Callout Driver Functions