- Check that the memory area is not being deleted before using it

svn path=/trunk/; revision=56051
This commit is contained in:
Cameron Gutman 2012-03-05 19:48:24 +00:00
parent d78bbd2aab
commit cfb8d5658b

View file

@ -113,7 +113,7 @@ MiZeroFillSection
MmLockAddressSpace(AddressSpace); MmLockAddressSpace(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
MmUnlockAddressSpace(AddressSpace); 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; return STATUS_NOT_MAPPED_DATA;
} }
@ -188,7 +188,7 @@ _MiFlushMappedSection
MmLockAddressSpace(AddressSpace); MmLockAddressSpace(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_CACHE) if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_CACHE || MemoryArea->DeleteInProgress)
{ {
MmUnlockAddressSpace(AddressSpace); MmUnlockAddressSpace(AddressSpace);
DPRINT("STATUS_NOT_MAPPED_DATA\n"); DPRINT("STATUS_NOT_MAPPED_DATA\n");
@ -698,7 +698,7 @@ MmUnmapViewOfCacheSegment
PMM_SECTION_SEGMENT Segment; PMM_SECTION_SEGMENT Segment;
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
if (MemoryArea == NULL) if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
{ {
ASSERT(MemoryArea); ASSERT(MemoryArea);
return(STATUS_UNSUCCESSFUL); return(STATUS_UNSUCCESSFUL);