NdisAllocateNetBufferMdlAndData - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// nblapi.h

NDIS_EXPORTED_ROUTINE NET_BUFFER * NdisAllocateNetBufferMdlAndData(
  [in] NDIS_HANDLE PoolHandle
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-nblapi-ndisallocatenetbuffermdlanddata)

NdisAllocateNetBufferMdlAndData function

Description

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

Parameters

PoolHandle [in]

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 get 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.

See also

NET_BUFFER

NdisAllocateNetBuffer

NdisFreeNetBuffer