Microsoft Windows CE 3.0  

NdisAllocateBuffer

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function creates a buffer descriptor mapping a specified virtual (sub)range within an already allocated, nonpaged memory block.

VOID NdisAllocateBuffer(
OUT PNDIS_STATUS
Status
,
OUT PNDIS_BUFFER *
Buffer
,
IN NDIS_HANDLE
PoolHandle
,
IN PVOID
VirtualAddress
,
IN UINT
Length
);

Parameters

Status
Pointer to a caller-supplied variable in which this function returns the final status of the buffer allocation.
Buffer
Pointer to a caller-supplied variable in which this function returns a pointer to the allocated buffer descriptor.
PoolHandle
Handle returned by a preceding call to the NdisAllocateBufferPoolfunction.
VirtualAddress
Pointer to the base virtual address of previously allocated system-space memory to be mapped in the returned buffer descriptor.
Length
Specifies the number of bytes to be mapped.

Return Values

NDIS_STATUS_SUCCESS indicates success. NDIS_STATUS_FAILURE indicates failure.

Remarks

This function allocates storage for and initializes a buffer descriptor to map a specified range of previously allocated memory, such as memory used for a packet header or an NIC receive buffer.

Buffer descriptor allocation draws on the buffer pool that NdisAllocateBufferPoolcreates. A driver can call this function as many times as necessary to allocate the buffer descriptors that it requires if it called NdisAllocateBufferPoolduring initialization.

The driver must release any spin lock that it is currently holding before calling this function.

All lower-level NDIS drivers must allocate all buffer descriptors that they chain to packets from a buffer pool. Only highest-level protocol drivers can be given OS-dependent descriptors mapping virtual memory ranges, and, if these memory descriptors are equivalent to NDIS buffer descriptors, a highest-level protocol can pass such descriptors as parameters to NDIS functions.

A driver that calls this function runs at IRQL <=DISPATCH_LEVEL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisAllocateBufferPool, NdisAllocateMemory, NdisFreeBuffer



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.