NdisBufferVirtualAddress function
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisBufferVirtualAddress returns the base virtual address for the buffer mapped by a given buffer descriptor. It maps the physical pages described by the given buffer descriptor onto system space if these pages are not already mapped to system space.
Syntax
PVOID NdisBufferVirtualAddress(
_In_ PNDIS_BUFFER Buffer
);
Parameters
- Buffer [in]
Pointer to a buffer descriptor from which the base virtual address is to be returned.
Return value
NdisBufferVirtualAddress returns the base system-space virtual address that maps the physical pages described by the given buffer descriptor.
Remarks
Drivers should call NdisBufferVirtualAddressSafe instead of NdisBufferVirtualAddress. NDIS 5.1 miniport drivers must call NdisBufferVirtualAddressSafe instead of NdisBufferVirtualAddress. Unlike NdisBufferVirtualAddress, NdisBufferVirtualAddressSafe does not cause a bug check if system resources are low or exhausted.
Drivers of PIO devices call NdisBufferVirtualAddress to translate a virtual address range, described by the buffer, for a user buffer to a system-space address range.
The returned base address has the same offset as the virtual address in the buffer.
Callers of NdisBufferVirtualAddress can be running at IRQL <= DISPATCH_LEVEL. However, a caller running at IRQL = DISPATCH_LEVEL must supply a buffer descriptor that maps nonpaged system-space addresses. The buffer itself must have been allocated from nonpaged pool, contiguous memory, or noncached memory.
Requirements
Target platform |
Universal |
Version |
Not supported for NDIS 6.0 drivers in Windows Vista. Use MmGetSystemAddressForMdlSafe instead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP. Use NdisBufferVirtualAddressSafe instead. |
Header |
Ndis.h (include Ndis.h) |
Library |
Ndis.lib |
IRQL |
<= DISPATCH_LEVEL (See Remarks section) |
See also