Bewerken

Delen via


NdisRetreatNetBufferListDataStart function (ndis/nblapi.h)

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

Syntax

NDIS_EXPORTED_ROUTINE NDIS_STATUS NdisRetreatNetBufferListDataStart(
  [in]           NET_BUFFER_LIST         *NetBufferList,
  [in]           ULONG                   DataOffsetDelta,
  [in]           ULONG                   DataBackFill,
  [in, optional] NET_BUFFER_ALLOCATE_MDL *AllocateMdlHandler,
  [in, optional] NET_BUFFER_FREE_MDL     *FreeMdlHandler
);

Parameters

[in] NetBufferList

A pointer to a previously allocated NET_BUFFER_LIST structure.

[in] DataOffsetDelta

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.

[in] DataBackFill

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

[in, optional] AllocateMdlHandler

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.

[in, optional] FreeMdlHandler

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 code Description
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

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Target Platform Universal
Header ndis/nblapi.h (include ndis.h)
Library Ndis.lib
IRQL <= DISPATCH_LEVEL
DDI compliance rules Irql_NetBuffer_Function(ndis)

See also

NET_BUFFER

NET_BUFFER_LIST

NdisAdvanceNetBufferDataStart NdisAdvanceNetBufferListDataStart NdisRetreatNetBufferDataStart

NetAllocateMdl

NetFreeMdl