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


NdisAllocateNetBufferMdlAndData (Compact 2013)

3/26/2014

NDIS drivers call this function to allocate a NET_BUFFER structure together with the associated MDL and data.

Syntax

PNET_BUFFER
  NdisAllocateNetBufferMdlAndData(
    IN  NDIS_HANDLE PoolHandle
    );

Parameters

  • PoolHandle
    A NET_BUFFER structure pool handle that was previously returned from a call to the NdisAllocateNetBufferPool function.

Return Value

NdisAllocateNetBufferMdlAndData returns a pointer to the NET_BUFFER structure that NDIS allocated. If the allocation was unsuccessful, this pointer is NULL.

Remarks

The caller must call the NdisAllocateNetBufferPool function and specify the maximum size of the data buffers. Given this value, NDIS can preallocate buffers for the caller.

This function allocates a NET_BUFFER structure, MDL and data in a single memory buffer. This is useful to achieve high performance when NET_BUFFER structures are frequently allocated and freed. The caller should not call NdisAllocateNetBuffer to allocate NET_BUFFERs out of NET_BUFFER pools which contain data.

NDIS uses the PoolHandle parameter to obtain a block of memory, and then creates the NET_BUFFER, MDL, and data buffer.

To free the NET_BUFFER and associated information, call the NdisFreeNetBuffer function.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NdisAllocateNetBuffer
NdisFreeNetBuffer
NET_BUFFER