Author: cgutman
Date: Mon Mar  5 19:48:24 2012
New Revision: 56051

URL: http://svn.reactos.org/svn/reactos?rev=56051&view=rev
Log:
[NEWCC]
- Check that the memory area is not being deleted before using it

Modified:
    trunk/reactos/ntoskrnl/cache/section/data.c

Modified: trunk/reactos/ntoskrnl/cache/section/data.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/data.c?rev=56051&r1=56050&r2=56051&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Mon Mar  5 
19:48:24 2012
@@ -113,7 +113,7 @@
        MmLockAddressSpace(AddressSpace);
        MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
        MmUnlockAddressSpace(AddressSpace);
-       if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW) 
+       if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW || 
MemoryArea->DeleteInProgress) 
        {
                return STATUS_NOT_MAPPED_DATA;
        }
@@ -188,7 +188,7 @@
 
        MmLockAddressSpace(AddressSpace);
        MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
-       if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_CACHE) 
+       if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_CACHE || 
MemoryArea->DeleteInProgress) 
        {
                MmUnlockAddressSpace(AddressSpace);
                DPRINT("STATUS_NOT_MAPPED_DATA\n");
@@ -698,7 +698,7 @@
    PMM_SECTION_SEGMENT Segment;
 
    MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
-   if (MemoryArea == NULL)
+   if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
    {
          ASSERT(MemoryArea);
       return(STATUS_UNSUCCESSFUL);


Reply via email to