[ros-diffs] [cwittich] 39289: halfplement MmCanFileBeTruncated

cwittich at svn.reactos.org cwittich at svn.reactos.org
Mon Feb 2 18:14:25 CET 2009


Author: cwittich
Date: Mon Feb  2 11:14:24 2009
New Revision: 39289

URL: http://svn.reactos.org/svn/reactos?rev=39289&view=rev
Log:
halfplement MmCanFileBeTruncated

Modified:
    trunk/reactos/ntoskrnl/mm/section.c

Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=39289&r1=39288&r2=39289&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Mon Feb  2 11:14:24 2009
@@ -4714,8 +4714,31 @@
 MmCanFileBeTruncated (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
                       IN PLARGE_INTEGER   NewFileSize)
 {
+ 
+   /* Check whether an ImageSectionObject exists */
+   if (SectionObjectPointer->ImageSectionObject != NULL)
+   {
+      return FALSE;
+   }
+
+   if (SectionObjectPointer->DataSectionObject != NULL)
+   {
+      PMM_SECTION_SEGMENT Segment;
+
+      Segment = (PMM_SECTION_SEGMENT)SectionObjectPointer->
+                DataSectionObject;
+
+      if (Segment->ReferenceCount != 0)
+      {
+         /* FIXME: check if NewFileSize <= current file size */
+         return FALSE;
+      }
+   }
+
+   /* FIXME: check for outstanding write probes */
    UNIMPLEMENTED;
-   return (FALSE);
+
+   return FALSE;
 }
 
 



More information about the Ros-diffs mailing list