NdisAdvanceNetBufferDataStart function (ndis/nblapi.h)

Call the NdisAdvanceNetBufferDataStart function to release the used data space that was added with the NdisRetreatNetBufferDataStart function.

Syntax

NDIS_EXPORTED_ROUTINE VOID NdisAdvanceNetBufferDataStart(
  [in]           NET_BUFFER          *NetBuffer,
  [in]           ULONG               DataOffsetDelta,
  [in]           BOOLEAN             FreeMdl,
  [in, optional] NET_BUFFER_FREE_MDL *FreeMdlHandler
);

Parameters

[in] NetBuffer

A pointer to a previously allocated NET_BUFFER structure.

[in] DataOffsetDelta

The amount of used data space to release. NDIS adjusts the value of the DataOffset member of the NET_BUFFER structure accordingly.

[in] FreeMdl

A BOOLEAN value that, if TRUE, requests NDIS to free any MDLs that become unused in the advance operation. If FreeMdl is FALSE, NDIS retains unused MDLs for use in subsequent retreat operations.

[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

None

Remarks

If NDIS allocated memory to satisfy a corresponding call to the NdisRetreatNetBufferDataStart function, then NdisAdvanceNetBufferDataStart frees the memory that NdisRetreatNetBufferDataStart allocated. Otherwise, the memory remains in the MDL and only the value of the DataOffset member of the NET_BUFFER structure is modified.

NDIS calls the NetFreeMdl function specified at FreeMdl if NdisAdvanceNetBufferDataStart must free memory. NDIS calls NetFreeMdl only to free the MDLs and memory that the driver allocated in the NetAllocateMdl function.

When protocol drivers call NdisAdvanceNetBufferDataStart on the receive path to access the various transport headers, the MDL chain should not be modified and FreeMdl is FALSE.

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

NdisRetreatNetBufferDataStart

NetAllocateMdl

NetFreeMdl