NdisAdvanceNetBufferDataStart function

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

Syntax

void NdisAdvanceNetBufferDataStart(
  PNET_BUFFER                 NetBuffer,
  ULONG                       DataOffsetDelta,
  BOOLEAN                     FreeMdl,
  NET_BUFFER_FREE_MDL_HANDLER FreeMdlHandler
);

Parameters

NetBuffer

A pointer to a previously allocated NET_BUFFER structure.

DataOffsetDelta

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

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.

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

   
Windows version Supported in NDIS 6.0 and later.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL "<= DISPATCH_LEVEL"
DDI compliance rules Irql_NetBuffer_Function

See Also

NET_BUFFER

NdisRetreatNetBufferDataStart

NetAllocateMdl

NetFreeMdl