VOID
NdisAllocateSharedMemory(
IN NDIS_HANDLE NdisAdapterHandle,
IN ULONG Length,
IN BOOLEAN Cached,
OUT PVOID *VirtualAddress,
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress
);
NdisAllocateSharedMemory is called by the NIC driver to request the operating system to allocate memory the NIC driver shares with a busmaster network interface card during DMA operations.
NIC drivers call this function during initialization. The operating system allocates the memory as physically contiguous, either cached or noncached. Because this function writes the physical address of the shared memory, the NIC driver must not call NdisGetBufferPhysicalMapping.
If the allocated memory is cached and the cache needs flushing, the NIC driver must call NdisAllocateBuffer to allocate a buffer descriptor for the memory. It then calls NdisFlushBuffer to flush the cache.
Callers of NdisAllocateSharedMemory run at IRQL PASSIVE_LEVEL.