VOID
NdisCopyBuffer(
OUT PNDIS_STATUS Status,
OUT PNDIS_BUFFER *Buffer,
IN NDIS_HANDLE PoolHandle,
IN PVOID MemoryDescriptor,
IN UINT Offset,
IN UINT Length
);
NdisCopyBuffer creates a buffer descriptor for a specified virtual (sub)range, given a handle for a block of already allocated memory and a pointer to the memory descriptor for the block.
NdisCopyBuffer creates a buffer descriptor mapping a (sub)range within a block of memory, described by a given memory descriptor. This function allocates storage for the new buffer descriptor and then copies information from the given MemoryDescriptor into the new buffer descriptor.
If the given memory descriptor contains chained elements, the buffer descriptor that NdisCopyBuffer creates can be the head of a chain of buffer descriptors. A driver can call NdisGetNextBuffer and then NdisQueryBuffer to query each chained buffer descriptor.
The driver must release any spin lock it is holding before calling NdisCopyBuffer. The driver must call NdisFreeBuffer to release the buffer descriptor when it is no longer needed.
Callers of NdisCopyBuffer run at IRQL PASSIVE_LEVEL.
NdisAllocateBufferPool, NdisFreeBuffer, NdisGetNextBuffer, NdisQueryBuffer, NdisReleaseSpinLock