ntdll: Change the virtual memory test to accept both READWRITE and WRITECOPY protections.

Dmitry Timoshkov dmitry at baikal.ru
Tue Nov 22 07:14:55 CST 2011


I decided to change the test to accept both READWRITE and WRITECOPY because
the PE linker is free to place unitialized and initializied data into the same
section (which it does), and the test for read-write uninitialized data in
reality does test the same data as the read-write data test above this one,
and that test does accept both READWRITE and WRITECOPY (I'd guess it does
that to workaround a difference between compiler tool chains used to compile
the tests).

The test initializers that call GetProcAddress() do write to the same section
where the static buffer resides, which leads to the image section protection
change.

Please use this patch as a replacement for [4/5] patch in the series.
---
 dlls/ntdll/tests/info.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index ec1ce3d..440f602 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1293,7 +1293,8 @@ static void test_queryvirtualmemory(void)
     {
         ok (mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "mbi.AllocationProtect is 0x%x, expected 0x%x\n", mbi.AllocationProtect, PAGE_EXECUTE_WRITECOPY);
         ok (mbi.State == MEM_COMMIT, "mbi.State is 0x%x, expected 0x%X\n", mbi.State, MEM_COMMIT);
-        ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected 0x%X\n", mbi.Protect, PAGE_READWRITE);
+        ok (mbi.Protect == PAGE_READWRITE || mbi.Protect == PAGE_WRITECOPY,
+            "mbi.Protect is 0x%x\n", mbi.Protect);
     }
     else skip( "bss is outside of module\n" );  /* this can happen on Mac OS */
 }
-- 
1.7.7.2




More information about the wine-patches mailing list