LogicalAddress MemAllocatePhysicallyContiguous (
ByteCount byteSize,
Boolean clear);
MemAllocatePhysicallyContiguous allocates a buffer that is resident and is guaranteed to be physically uninterrupted. It returns the buffer's logical address.
Driver code can pass the address returned by MemAllocatePhysicallyContiguous to PrepareMemoryForIO to obtain the buffer's physical location.
MemAllocatePhysicallyContiguous may be called only from task level, not from secondary or hardware interrupt level. Requesting a larger size especially anytime after your driver initially starts up is unlikely to succeed.