[ros-diffs] [fireball] 38360: - 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.

fireball at svn.reactos.org fireball at svn.reactos.org
Fri Dec 26 21:34:40 CET 2008


Author: fireball
Date: Fri Dec 26 14:34:40 2008
New Revision: 38360

URL: http://svn.reactos.org/svn/reactos?rev=38360&view=rev
Log:
- 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.

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/iomdl.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/iomdl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomdl.c?rev=38360&r1=38359&r2=38360&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iomdl.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iomdl.c [iso-8859-1] Fri Dec 26 14:34:40 2008
@@ -98,6 +98,10 @@
     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 @@
 
     /* 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 */



More information about the Ros-diffs mailing list