다음을 통해 공유


NdisRetreatNetBufferListDataStart (Compact 2013)

3/26/2014

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

Syntax

NDIS_STATUS
  NdisRetreatNetBufferListDataStart(
    IN PNET_BUFFER_LIST  NetBufferList,
    IN ULONG  DataOffsetDelta,
    IN ULONG  DataBackFill,
    IN NET_BUFFER_ALLOCATE_MDL_HANDLER  AllocateMdlHandler OPTIONAL

    IN NET_BUFFER_FREE_MDL_HANDLER  FreeMdlHandler OPTIONAL
    );

Parameters

  • NetBufferList
    A pointer to a previously allocated NET_BUFFER_LIST structure.
  • DataOffsetDelta
    The 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.
  • 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.
  • 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.
  • 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:

  • 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 because of 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. Or, the driver can call the NdisAdvanceNetBufferDataStart function for each NET_BUFFER structure on the NET_BUFFER_LIST structure. Calling NdisAdvanceNetBufferListDataStart is more efficient.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NET_BUFFER
NET_BUFFER_LIST
NetAllocateMdl
NetFreeMdl
NdisAdvanceNetBufferDataStart
NdisAdvanceNetBufferListDataStart
NdisRetreatNetBufferDataStart