Поделиться через


NdisAdvanceNetBufferDataStart (Compact 2013)

3/26/2014

Call this function to release the used data space that was added by using the NdisRetreatNetBufferDataStart function.

Syntax

VOID
  NdisAdvanceNetBufferDataStart(
    IN PNET_BUFFER  NetBuffer,
    IN ULONG  DataOffsetDelta,
    IN  BOOLEAN  FreeMdl,
    IN  NET_BUFFER_FREE_MDL_HANDLER  FreeMdlHandler OPTIONAL
    );

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 keeps 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, 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

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NET_BUFFER
NetAllocateMdl
NetFreeMdl
NdisRetreatNetBufferDataStart