FwpsAllocateNetBufferAndNetBufferList0 function

The FwpsAllocateNetBufferAndNetBufferList0 function allocates a new NET_BUFFER_LIST structure.

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

Syntax


NTSTATUS NTAPI FwpsAllocateNetBufferAndNetBufferList0(
  _In_     NDIS_HANDLE     poolHandle,
  _In_     USHORT          contextSize,
  _In_     USHORT          contextBackFill,
  _In_opt_ MDL             *mdlChain,
  _In_     ULONG           dataOffset,
  _In_     SIZE_T          dataLength,
  _Out_    NET_BUFFER_LIST **netBufferList
);

Parameters

poolHandle [in]

A NET_BUFFER_LIST pool handle that was obtained from a previous call to the NdisAllocateNetBufferListPool function.

contextSize [in]

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 defined by MEMORY_ALLOCATION_ALIGNMENT.

contextBackFill [in]

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 defined by MEMORY_ALLOCATION_ALIGNMENT.

mdlChain [in, optional]

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 [in]

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 [in]

The length, in bytes, of the used data space in the MDL chain.

netBufferList [out]

A pointer to a variable that receives a pointer to the new NET_BUFFER_LIST structure.

Return value

The FwpsAllocateNetBufferAndNetBufferList0 function returns one of the following NTSTATUS codes.

Return codeDescription
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, but 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 frees the new NET_BUFFER_LIST structure by calling the FwpsFreeNetBufferList0 function.

Requirements

Target platform

Universal

Version

Available starting with Windows Vista.

Header

Fwpsk.h (include Fwpsk.h)

Library

Fwpkclnt.lib

IRQL

<= DISPATCH_LEVEL

See also

FwpsFreeNetBufferList0
NdisAllocateNetBufferAndNetBufferList
NdisAllocateNetBufferListPool
NET_BUFFER_LIST
NET_BUFFER_LIST_CONTEXT
Packet Injection Functions

 

 

Send comments about this topic to Microsoft

Show: