阅读:4606回复:2
请教有关IoBuildPartialMdl
MSDN上数IoBuildPartialMdl 创建一个已存在MDL的子MDL 。不是很明白,执行了IoAllocateMdl,为啥还要执行IoBuildPartialMdl 呢?
在bulusb中有这样的代码。 mdl = IoAllocateMdl((PVOID) virtualAddress, totalLength, FALSE, FALSE, NULL); 。。。。。 IoBuildPartialMdl(Irp->MdlAddress, mdl, (PVOID) virtualAddress, stageLength); 可不可以写成这样呢?? mdl = IoAllocateMdl((PVOID) virtualAddress, stageLength, FALSE, FALSE, NULL); |
|
|
沙发#
发布于:2007-12-11 22:45
IoAllocateMdl:
Allocates an MDL for a buffer, given the starting virtual address of the buffer and its length. This routine does not associate the physical pages in the buffer with the allocated MDL. To do so, the driver must call MmBuildMdlForNonPagedPool, IoBuildPartialMdl, or MmProbeAndLockPages. 这个函数没有把对应物理页的内容填入~~~ |
|
板凳#
发布于:2013-06-24 10:12
IoAllocateMdl 后不执行IoFreeMdl 会不会导致内存泄露等问题? 我看到WDK中的Example有的执行有的不执行。
|
|