- Fix broken behavior of IoBuildPartialMdl, which instead of copying 4 flags from a source mdl to a target one was always setting all of them, thus often making resultant mdl unusable.

svn path=/trunk/; revision=38360
This commit is contained in:
Aleksey Bragin 2008-12-26 20:34:40 +00:00
parent d3a5bca37f
commit 65dc6d8f5c

View file

@ -98,6 +98,10 @@ IoBuildPartialMdl(IN PMDL SourceMdl,
PPFN_NUMBER TargetPages = (PPFN_NUMBER)(TargetMdl + 1);
PPFN_NUMBER SourcePages = (PPFN_NUMBER)(SourceMdl + 1);
ULONG Offset;
ULONG FlagsMask = (MDL_IO_PAGE_READ |
MDL_SOURCE_IS_NONPAGED_POOL |
MDL_MAPPED_TO_SYSTEM_VA |
MDL_IO_SPACE);
/* Calculate the offset */
Offset = (ULONG)((ULONG_PTR)VirtualAddress -
@ -118,10 +122,7 @@ IoBuildPartialMdl(IN PMDL SourceMdl,
/* Set the MDL Flags */
TargetMdl->MdlFlags = (MDL_ALLOCATED_FIXED_SIZE | MDL_ALLOCATED_MUST_SUCCEED);
TargetMdl->MdlFlags |= (MDL_IO_PAGE_READ |
MDL_SOURCE_IS_NONPAGED_POOL |
MDL_MAPPED_TO_SYSTEM_VA |
MDL_IO_SPACE);
TargetMdl->MdlFlags |= SourceMdl->MdlFlags & FlagsMask;
TargetMdl->MdlFlags |= MDL_PARTIAL;
/* Set the mapped VA */