NdisAdvanceNetBufferDataStart function

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

Syntax


VOID NdisAdvanceNetBufferDataStart(
  _In_     PNET_BUFFER                 NetBuffer,
  _In_     ULONG                       DataOffsetDelta,
  _In_     BOOLEAN                     FreeMdl,
  _In_opt_ NET_BUFFER_FREE_MDL_HANDLER FreeMdlHandler
);

Parameters

NetBuffer [in]

A pointer to a previously allocated NET_BUFFER structure.

DataOffsetDelta [in]

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

FreeMdl [in]

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

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

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
NetAllocateMdl
NetFreeMdl
NdisRetreatNetBufferDataStart

 

 

Send comments about this topic to Microsoft

Show: