NdisRetreatNetBufferListDataStart function

Call the NdisRetreatNetBufferListDataStart function to increase the used data space in all the NET_BUFFER structures in a NET_BUFFER_LIST structure.

Syntax


NDIS_STATUS NdisRetreatNetBufferListDataStart(
  _In_     PNET_BUFFER_LIST                NetBufferList,
  _In_     ULONG                           DataOffsetDelta,
  _In_     ULONG                           DataBackFill,
  _In_opt_ NET_BUFFER_ALLOCATE_MDL_HANDLER AllocateMdlHandler,
  _In_opt_ NET_BUFFER_FREE_MDL_HANDLER     FreeMdlHandler
);

Parameters

NetBufferList [in]

A pointer to a previously allocated NET_BUFFER_LIST structure.

DataOffsetDelta [in]

The amount of additional used data space in each NET_BUFFER structure. If there is not enough unused data space to satisfy the request, NDIS allocates more memory.

DataBackFill [in]

If NDIS must allocate memory, this parameter specifies the amount of data space in addition to the value of the DataOffsetDelta parameter to allocate.

AllocateMdlHandler [in, optional]

An optional entry point for an NetAllocateMdl function. If the caller specifies an entry point for the NetAllocateMdl function, NDIS calls NetAllocateMdl to allocate an MDL and memory.

FreeMdlHandler [in, optional]

An optional entry point for an NetFreeMdl function. If the caller specifies an entry point for the NetFreeMdl function, NDIS calls NetFreeMdl to free an MDL and memory.

Return value

NdisRetreatNetBufferListDataStart returns one of the following:

Return codeDescription
NDIS_STATUS_SUCCESS

NdisRetreatNetBufferListDataStart successfully allocated the data space on all the NET_BUFFER structures either by reducing the value of the DataOffset member or by allocating new storage.

NDIS_STATUS_RESOURCES

NdisRetreatNetBufferListDataStart failed due to insufficient resources.

NDIS_STATUS_FAILURE

NdisRetreatNetBufferListDataStart failed for reasons other than insufficient resources.

 

Remarks

Calling NdisRetreatNetBufferListDataStart is the equivalent of calling the NdisRetreatNetBufferDataStart function for every NET_BUFFER structure on the NET_BUFFER_LIST structure. NdisRetreatNetBufferListDataStart attempts to satisfy the request by reducing the value of the DataOffset member in every NET_BUFFER structure. If there is not enough unused data space available, this function allocates a new buffer and MDL, and then chains the new MDL to the beginning of the MDL chain on the NET_BUFFER structure.

Call the NdisAdvanceNetBufferListDataStart function to release data space that was claimed in a previous NdisRetreatNetBufferListDataStart call. Alternatively, the driver can call the NdisAdvanceNetBufferDataStart function for each NET_BUFFER structure on the NET_BUFFER_LIST structure. Calling NdisAdvanceNetBufferListDataStart is more efficient.

Requirements

Target platform

Universal

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

Irql_NetBuffer_Function

See also

NET_BUFFER
NET_BUFFER_LIST
NetAllocateMdl
NetFreeMdl
NdisAdvanceNetBufferDataStart
NdisAdvanceNetBufferListDataStart
NdisRetreatNetBufferDataStart

 

 

Send comments about this topic to Microsoft

Show: