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.
VOID NdisCopyBuffer( _Out_ PNDIS_STATUS Status, _Out_ PNDIS_BUFFER *Buffer, _In_ NDIS_HANDLE PoolHandle, _In_ PVOID MemoryDescriptor, _In_ UINT Offset, _In_ UINT Length );
- Status [out]
Pointer to a caller-supplied variable in which this function returns the final status of the buffer descriptor copy operation, which can be one of the following:
The driver can use the buffer descriptor or buffer descriptor chain returned at Buffer.
An attempt to map the given range failed, possibly because of an out-of-range Offset and Length specification.
- Buffer [out]
Pointer to a caller-supplied variable in which this function returns a pointer to the new buffer descriptor if the call is successful.
- PoolHandle [in]
Specifies the handle returned by a preceding call to NdisAllocateBufferPool.
- MemoryDescriptor [in]
Pointer to the memory descriptor, which can be of type NDIS_BUFFER.
- Offset [in]
Specifies the byte offset within the memory block at which to start the copy.
- Length [in]
Specifies the number of bytes to copy.
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 or NdisQueryBufferSafe 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.
|Not supported for NDIS 6.0 drivers in Windows Vista. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.|
Build date: 3/28/2013