Author: ion
Date: Mon Feb 6 08:17:03 2012
New Revision: 55452
URL:
http://svn.reactos.org/svn/reactos?rev=55452&view=rev
Log:
[NTOSKRNL]: Finish implementation of NtAreMappedFilesTheSame based on what winetests
revealed. Should fix all 20+ winetests in this area, on top of making Ldr suck less.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Mon Feb 6 08:17:03 2012
@@ -1387,8 +1387,6 @@
PMEMORY_AREA MemoryArea1, MemoryArea2;
PROS_SECTION_OBJECT Section1, Section2;
- DPRINT1("Is image: %p the same as file: %p?\n", File1MappedAsAnImage,
File2MappedAsFile);
-
/* Lock address space */
AddressSpace = MmGetCurrentAddressSpace();
MmLockAddressSpace(AddressSpace);
@@ -1398,7 +1396,6 @@
if (!MemoryArea1)
{
/* Fail, the address does not exist */
- DPRINT1("Invalid address\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_INVALID_ADDRESS;
}
@@ -1407,7 +1404,6 @@
if (MemoryArea1->Type != MEMORY_AREA_SECTION_VIEW)
{
/* Fail, the address is not a section */
- DPRINT1("Invalid address (not a section)\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_CONFLICTING_ADDRESSES;
}
@@ -1416,7 +1412,6 @@
Section1 = MemoryArea1->Data.SectionData.Section;
if (Section1->FileObject == NULL)
{
- DPRINT1("No file object\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_CONFLICTING_ADDRESSES;
}
@@ -1426,7 +1421,6 @@
if (!MemoryArea2)
{
/* Fail, the address does not exist */
- DPRINT1("Invalid address\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_INVALID_ADDRESS;
}
@@ -1435,7 +1429,6 @@
if (MemoryArea2->Type != MEMORY_AREA_SECTION_VIEW)
{
/* Fail, the address is not a section */
- DPRINT1("Invalid address (not a section)\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_CONFLICTING_ADDRESSES;
}
@@ -1444,23 +1437,17 @@
Section2 = MemoryArea2->Data.SectionData.Section;
if (Section2->FileObject == NULL)
{
- DPRINT1("No file object\n");
MmUnlockAddressSpace(AddressSpace);
return STATUS_CONFLICTING_ADDRESSES;
}
- /* These dbgprints should allow me to see what should w ecompare in ROS's section
implementation once the winetests are run... for now lie and say they're not equal.
*/
- DPRINT1("FO1/2: %p %p\n", Section1->FileObject,
Section2->FileObject);
- DPRINT1("SOP: %p %p\n",
- Section1->FileObject->SectionObjectPointer,
- Section2->FileObject->SectionObjectPointer);
- DPRINT1("SCM: %p %p\n",
- Section1->FileObject->SectionObjectPointer->SharedCacheMap,
- Section2->FileObject->SectionObjectPointer->SharedCacheMap);
- DPRINT1("ISO: %p %p\n",
- Section1->FileObject->SectionObjectPointer->ImageSectionObject,
- Section2->FileObject->SectionObjectPointer->ImageSectionObject);
- DPRINT1("SISO: %p %p\n", Section1->ImageSection,
Section2->ImageSection);
+ /* The shared cache map seems to be the same if both of these are equal */
+ if (Section1->FileObject->SectionObjectPointer->SharedCacheMap ==
+ Section2->FileObject->SectionObjectPointer->SharedCacheMap)
+ {
+ MmUnlockAddressSpace(AddressSpace);
+ return STATUS_SUCCESS;
+ }
/* Unlock address space */
MmUnlockAddressSpace(AddressSpace);