Re: MmAllocatePagesForMdl函数返回总是失败

Windows驱动开发

MmAllocatePagesForMdl函数返回总是失败


ustc466 2010-09-21, 09:13 上午
在win32平台下,为一个MDL分配4K的内存的代码如下,为什么MmAllocatePagesForMdl返回总是失败?望大家指教,多谢!

PHYSICAL_ADDRESS LowAddress;
PHYSICAL_ADDRESS HighAddress;
SIZE_T TotalBytes;

// 初始化MmAllocatePagesForMdl需要的Physical Address
LowAddress.QuadPart = 0;
HighAddress.QuadPart = PAGE_SIZE;
TotalBytes = PAGE_SIZE;

// 分配4K的共享缓冲区
Mdl = MmAllocatePagesForMdl(LowAddress,
HighAddress,
LowAddress,
TotalBytes);

Re: MmAllocatePagesForMdl函数返回总是失败


格蠹老雷 2010-09-23, 22:57 下午
参数指定的条件有点太苛刻了...

Powered by Community Server Powered by CnForums.Net