ntdll/tests: Use compiler generated code for map protection test

André Hentschel nerv at dawncrow.de
Wed Nov 27 11:18:11 CST 2013


Mostly for ARM

---
 dlls/ntdll/tests/info.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index ef1bed5..55a865d 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1316,6 +1316,10 @@ static void test_readvirtualmemory(void)
     CloseHandle(process);
 }
 
+static void retfunc(void)
+{
+}
+
 static void test_mapprotection(void)
 {
     HANDLE h;
@@ -1359,12 +1363,11 @@ static void test_mapprotection(void)
     addr = NULL;
     status = pNtMapViewOfSection ( h, GetCurrentProcess(), &addr, 0, 0, &offset, &count, ViewShare, 0, PAGE_READWRITE);
     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
-#if defined(__x86_64__) || defined(__i386__)
-    memset (addr, 0xc3, 1); /* lret ... in both i386 and x86_64 */
+
+    memcpy(addr, retfunc, count);
     trace("trying to execute code in the readwrite only mapped anon file...\n");
     f = addr;f();
     trace("...done.\n");
-#endif
 
     status = pNtQueryVirtualMemory( GetCurrentProcess(), addr, MemoryBasicInformation, &info, sizeof(info), &retlen );
     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
-- 
1.8.1.2




More information about the wine-patches mailing list