NdisQueryBufferOffset

VOID
   NdisQueryBufferOffset(

       IN PNDIS_BUFFER Buffer,
       OUT PUINT Offset,
       OUT PUINT Length
       );

NdisQueryBufferOffset retrieves the base virtual address of the range specified in a given buffer descriptor.

Parameters

Buffer

Points to the buffer descriptor.

Offset

Points to a caller-supplied variable in which this function returns the zero-based byte offset within the physical page containing the buffer.

Length

Points to a caller-supplied variable in which this function returns the size in bytes of the given buffer.

Comments

NdisQueryBufferOffset returns the offset within a physical page at which a given buffer begins. Usually, the buffer descriptor was part of a packet chain.

NdisQueryBufferOffset runs faster than NdisQueryBuffer. NDIS drivers call NdisQueryBufferOffset in situations where they need to constrain packets by certain criteria. For example, NdisQueryBufferOffset can be used to determine if a buffer crosses a page boundary, if it is odd-byte aligned, and so forth.

Callers of NdisQueryBufferOffset run at IRQL <= DISPATCH_LEVEL.

See Also

NdisAllocateBuffer, NdisQueryBuffer, NdisQueryPacket, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront