[5/5] ntdll: Revert 33b0f0edffa0c8a06b4ee8831c92fdc373f83ece.

Dmitry Timoshkov dmitry at baikal.ru
Tue Nov 22 04:03:22 CST 2011


The tests clearly show that this commit is wrong.
---
 dlls/kernel32/tests/loader.c |   10 ----------
 dlls/ntdll/virtual.c         |    8 +-------
 2 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 3bc7540..2af7cc5 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -691,11 +691,6 @@ static void test_section_access(void)
             "%d: VirtualQuery error %d\n", i, GetLastError());
         ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress);
         ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize);
-        /* FIXME: remove the condition below once Wine is fixed */
-        if ((td[i].scn_file_access & IMAGE_SCN_MEM_WRITE) &&
-            (td[i].scn_file_access & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
-        todo_wine ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access);
-        else
         ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access);
         ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib);
         ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect);
@@ -735,11 +730,6 @@ static void test_section_access(void)
             "%d: VirtualQuery error %d\n", i, GetLastError());
         ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress);
         ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize);
-        /* FIXME: remove the condition below once Wine is fixed */
-        if ((td[i].scn_file_access & IMAGE_SCN_MEM_WRITE) &&
-            (td[i].scn_file_access & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
-        todo_wine ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access);
-        else
         ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access);
         ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib);
         ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect);
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index fb8786f..9853628 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1345,14 +1345,8 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
             size = ROUND_SIZE( sec->VirtualAddress, sec->SizeOfRawData );
 
         if (sec->Characteristics & IMAGE_SCN_MEM_READ)    vprot |= VPROT_READ;
+        if (sec->Characteristics & IMAGE_SCN_MEM_WRITE)   vprot |= VPROT_WRITECOPY;
         if (sec->Characteristics & IMAGE_SCN_MEM_EXECUTE) vprot |= VPROT_EXEC;
-        if (sec->Characteristics & IMAGE_SCN_MEM_WRITE)
-        {
-            if (sec->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
-                vprot |= VPROT_WRITE;
-            else
-                vprot |= VPROT_WRITECOPY;
-        }
 
         /* Dumb game crack lets the AOEP point into a data section. Adjust. */
         if ((nt->OptionalHeader.AddressOfEntryPoint >= sec->VirtualAddress) &&
-- 
1.7.7.2




More information about the wine-patches mailing list