Commit 517d0800 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

ntdll: Revert 33b0f0ed.

The tests clearly show that this commit is wrong.
parent 27725915
......@@ -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);
......
......@@ -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) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment