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=3... ============================================================================== --- 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; }