The ZeroBits parameter doesn't behave as expected, and some 64bit code use it to allocate memory in the lower 32bit address space.
The expected full behaviour is:
* ZeroBits == 0: no constraint on address range * 0 < ZeroBits <= 15: returned address should have as many upper bits set to 0, starting at bit 31. In 64bit mode, upper 64bits should all be 0 as well. * 15 < ZeroBits <= 31: unsure, but probably same as ZeroBits == 15. * ZeroBits > 31: (64bit/WoW64 only) ZeroBits behaves as a bitmask, as if it was set to the number of leading 0 in the bitmask, works in the whole 64bit range.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernel32/tests/virtual.c | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 474955630fd..91dc654580e 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -228,10 +228,12 @@ static void test_VirtualAllocEx(void) static void test_VirtualAlloc(void) { void *addr1, *addr2; + ULONG zero_bits; DWORD old_prot; MEMORY_BASIC_INFORMATION info; NTSTATUS status; SIZE_T size; + BOOL is_wow64;
SetLastError(0xdeadbeef); addr1 = VirtualAlloc(0, 0, MEM_RESERVE, PAGE_NOACCESS); @@ -461,6 +463,7 @@ static void test_VirtualAlloc(void) addr2 = NULL; status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 21, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + todo_wine ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); @@ -473,6 +476,80 @@ static void test_VirtualAlloc(void) ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n");
+ /* 1 zero bits should zero 63-31 upper bits */ + size = 0x1000; + addr2 = NULL; + zero_bits = 1; + status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 1, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + todo_wine + ok((status == STATUS_SUCCESS || broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */) && + ((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, + "NtAllocateVirtualMemory returned %08x, addr2: %p\n", status, addr2); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + /* 2 zero bits should zero 63-31 upper bits */ + size = 0x1000; + addr2 = NULL; + zero_bits = 2; + status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, zero_bits, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + todo_wine + ok(status == STATUS_SUCCESS && ((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, + "NtAllocateVirtualMemory returned %08x, addr2: %p\n", status, addr2); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + /* 15 zero bits should zero 63-17 upper bits */ + size = 0x1000; + addr2 = NULL; + zero_bits = 15; + status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, zero_bits, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + todo_wine + ok((status == STATUS_SUCCESS || status == STATUS_NO_MEMORY) && ((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, + "NtAllocateVirtualMemory returned %08x, addr2: %p\n", status, addr2); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + /* zero bits > 31 should be considered as bitmask on 64bit and WoW64 */ + size = 0x1000; + addr2 = NULL; + zero_bits = 0x1fffffff; + status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, zero_bits, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + + if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || + !pIsWow64Process( GetCurrentProcess(), &is_wow64 ) || !is_wow64)) + { + ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status); + } + else + { + todo_wine + ok(status == STATUS_SUCCESS && ((UINT_PTR)addr2 & ~zero_bits) == 0, + "NtAllocateVirtualMemory returned %08x, addr2: %p\n", status, addr2); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + } + /* AT_ROUND_TO_PAGE flag is not supported for VirtualAlloc */ SetLastError(0xdeadbeef); addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE);
Memory allocated with NtAllocateVirtualMemory should be freed with NtFreeVirtualMemory, for consistency.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernel32/tests/virtual.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 91dc654580e..3e833dac2bc 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -456,7 +456,12 @@ static void test_VirtualAlloc(void) MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); todo_wine ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + }
/* 21 zero bits is valid */ size = 0x1000; @@ -466,7 +471,12 @@ static void test_VirtualAlloc(void) todo_wine ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + }
/* 22 zero bits is invalid */ size = 0x1000; @@ -474,7 +484,12 @@ static void test_VirtualAlloc(void) status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 22, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); + if (status == STATUS_SUCCESS) + { + size = 0; + status = pNtFreeVirtualMemory(GetCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "pNtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + }
/* 1 zero bits should zero 63-31 upper bits */ size = 0x1000;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52868
Your paranoid android.
=== wvistau64 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_zh_CN (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_fr (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_he (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w2008s64 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w7u (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w7pro64 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w8 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w8adm (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w864 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1507 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1809 (32 bit report) ===
kernel32: virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 0, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:2987: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3126: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3144: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3225: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3249: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2931: Test failed: expected policy flags 1, got 3 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3045: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3108: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3289: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3314: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2893: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2932: Test failed: expected policy permanent FALSE, got 1 virtual.c:3351: Test failed: NtSetInformationProcess failed with status c0000022
=== debian9 (32 bit report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit French report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit Japanese:Japan report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit Chinese:China report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit WoW report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (64 bit WoW report) ===
kernel32: virtual.c:472: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:501: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:518: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
This parameter was misinterpreted as an alignment parameter for the lower bits of the allocated memory region, although it is a constraint on the higher bits.
This patch adds a new exported __wine_allocate_virtual_memory function that has a separate alignment parameter which is now used instead of the zero_bits parameter.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/commdlg.dll16/filedlg.c | 8 ++++++-- dlls/ntdll/directory.c | 4 ++-- dlls/ntdll/heap.c | 7 ++++--- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/ntdll_misc.h | 3 +++ dlls/ntdll/server.c | 9 +++++---- dlls/ntdll/signal_arm.c | 13 +++++++------ dlls/ntdll/signal_arm64.c | 17 +++++++++-------- dlls/ntdll/signal_i386.c | 17 +++++++++-------- dlls/ntdll/signal_powerpc.c | 13 +++++++------ dlls/ntdll/signal_x86_64.c | 17 +++++++++-------- dlls/ntdll/thread.c | 4 ++-- dlls/ntdll/virtual.c | 30 ++++++++++++++++++++++++------ include/wine/server_protocol.h | 1 + 14 files changed, 89 insertions(+), 55 deletions(-)
diff --git a/dlls/commdlg.dll16/filedlg.c b/dlls/commdlg.dll16/filedlg.c index 5b72bfab100..d86ecd7d41c 100644 --- a/dlls/commdlg.dll16/filedlg.c +++ b/dlls/commdlg.dll16/filedlg.c @@ -504,13 +504,17 @@ struct hook_proc
static LPOFNHOOKPROC alloc_hook( LPOFNHOOKPROC16 hook16 ) { + extern NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret, ULONG zero_bits, + SIZE_T *size_ptr, ULONG type, ULONG protect, + ULONG alignment ); + static struct hook_proc *hooks; static unsigned int count; SIZE_T size = 0x1000; unsigned int i;
- if (!hooks && NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&hooks, 12, &size, - MEM_COMMIT, PAGE_EXECUTE_READWRITE )) + if (!hooks && __wine_allocate_virtual_memory( GetCurrentProcess(), (void **)&hooks, 0, &size, + MEM_COMMIT, PAGE_EXECUTE_READWRITE, 12 )) return NULL;
for (i = 0; i < count; i++) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index bbdbbe9781f..68c268ea9a9 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1603,14 +1603,14 @@ static KERNEL_DIRENT *start_vfat_ioctl( int fd ) SIZE_T size = 2 * sizeof(*de) + page_size; void *addr = NULL;
- if (NtAllocateVirtualMemory( GetCurrentProcess(), &addr, 1, &size, MEM_RESERVE, PAGE_READWRITE )) + if (__wine_allocate_virtual_memory( GetCurrentProcess(), &addr, 0, &size, MEM_RESERVE, PAGE_READWRITE, 1 )) return NULL; /* commit only the size needed for the dir entries */ /* this leaves an extra unaccessible page, which should make the kernel */ /* fail with -EFAULT before it stomps all over our memory */ de = addr; size = 2 * sizeof(*de); - NtAllocateVirtualMemory( GetCurrentProcess(), &addr, 1, &size, MEM_COMMIT, PAGE_READWRITE ); + __wine_allocate_virtual_memory( GetCurrentProcess(), &addr, 0, &size, MEM_COMMIT, PAGE_READWRITE, 1 ); }
/* set d_reclen to 65535 to work around an AFS kernel bug */ diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index cccaaee1d45..b25640d4cc6 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -726,8 +726,9 @@ static void *allocate_large_block( HEAP *heap, DWORD flags, SIZE_T size ) LPVOID address = NULL;
if (block_size < size) return NULL; /* overflow */ - if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 5, - &block_size, MEM_COMMIT, get_protection_type( flags ) )) + if (__wine_allocate_virtual_memory( NtCurrentProcess(), &address, 0, + &block_size, MEM_COMMIT, get_protection_type( flags ), + 5 )) { WARN("Could not allocate block for %08lx bytes\n", size ); return NULL; @@ -1521,7 +1522,7 @@ void heap_set_debug_flags( HANDLE handle ) void *ptr = NULL; SIZE_T size = MAX_FREE_PENDING * sizeof(*heap->pending_free);
- if (!NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, 4, &size, MEM_COMMIT, PAGE_READWRITE )) + if (!__wine_allocate_virtual_memory( NtCurrentProcess(), &ptr, 0, &size, MEM_COMMIT, PAGE_READWRITE, 4 )) { heap->pending_free = ptr; heap->pending_pos = 0; diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 050ebc76410..29ff3a017ae 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1514,6 +1514,7 @@
# Virtual memory @ cdecl __wine_locked_recvmsg(long ptr long) +@ cdecl __wine_allocate_virtual_memory(long ptr long ptr long long long)
# Version @ cdecl wine_get_version() NTDLL_wine_get_version diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 2d83f541bd5..a629ea8751c 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -168,6 +168,9 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S UINT disposition ) DECLSPEC_HIDDEN;
/* virtual memory */ +extern NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret, ULONG zero_bits, + SIZE_T *size_ptr, ULONG type, ULONG protect, + ULONG alignment ); extern NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG protect, pe_image_info_t *image_info ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 094b5309500..f7352e73cd6 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -429,10 +429,11 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) size = call->virtual_alloc.size; if ((ULONG_PTR)addr == call->virtual_alloc.addr && size == call->virtual_alloc.size) { - result->virtual_alloc.status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, - call->virtual_alloc.zero_bits, &size, - call->virtual_alloc.op_type, - call->virtual_alloc.prot ); + result->virtual_alloc.status = __wine_allocate_virtual_memory( NtCurrentProcess(), &addr, + call->virtual_alloc.zero_bits, &size, + call->virtual_alloc.op_type, + call->virtual_alloc.prot, + call->virtual_alloc.alignment ); result->virtual_alloc.addr = wine_server_client_ptr( addr ); result->virtual_alloc.size = size; } diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index e01c8ce2193..5c567fcf125 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -967,22 +967,23 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) */ NTSTATUS signal_alloc_thread( TEB **teb ) { - static size_t sigstack_zero_bits; + static size_t sigstack_alignment; SIZE_T size; NTSTATUS status;
- if (!sigstack_zero_bits) + if (!sigstack_alignment) { size_t min_size = page_size; /* find the first power of two not smaller than min_size */ - while ((1u << sigstack_zero_bits) < min_size) sigstack_zero_bits++; + while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; assert( sizeof(TEB) <= min_size ); }
- size = 1 << sigstack_zero_bits; + size = 1 << sigstack_alignment; *teb = NULL; - if (!(status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)teb, sigstack_zero_bits, - &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ))) + if (!(status = __wine_allocate_virtual_memory( NtCurrentProcess(), (void **)teb, 0, + &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, + sigstack_alignment ))) { (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 94520c95ced..4f0ab02b719 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -871,24 +871,25 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) */ NTSTATUS signal_alloc_thread( TEB **teb ) { - static size_t sigstack_zero_bits; + static size_t sigstack_alignment; SIZE_T size; NTSTATUS status;
- if (!sigstack_zero_bits) + if (!sigstack_alignment) { size_t min_size = teb_size + max( MINSIGSTKSZ, 8192 ); /* find the first power of two not smaller than min_size */ - sigstack_zero_bits = 12; - while ((1u << sigstack_zero_bits) < min_size) sigstack_zero_bits++; - signal_stack_size = (1 << sigstack_zero_bits) - teb_size; + sigstack_alignment = 12; + while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; + signal_stack_size = (1 << sigstack_alignment) - teb_size; assert( sizeof(TEB) <= teb_size ); }
- size = 1 << sigstack_zero_bits; + size = 1 << sigstack_alignment; *teb = NULL; - if (!(status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)teb, sigstack_zero_bits, - &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ))) + if (!(status = __wine_allocate_virtual_memory( NtCurrentProcess(), (void **)teb, 0, + &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, + sigstack_alignment ))) { (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index b4e88d125f1..719c3ce7281 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -2312,25 +2312,26 @@ static void ldt_unlock(void) */ NTSTATUS signal_alloc_thread( TEB **teb ) { - static size_t sigstack_zero_bits; + static size_t sigstack_alignment; struct x86_thread_data *thread_data; SIZE_T size; void *addr = NULL; NTSTATUS status;
- if (!sigstack_zero_bits) + if (!sigstack_alignment) { size_t min_size = teb_size + max( MINSIGSTKSZ, 8192 ); /* find the first power of two not smaller than min_size */ - sigstack_zero_bits = 12; - while ((1u << sigstack_zero_bits) < min_size) sigstack_zero_bits++; - signal_stack_mask = (1 << sigstack_zero_bits) - 1; - signal_stack_size = (1 << sigstack_zero_bits) - teb_size; + sigstack_alignment = 12; + while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; + signal_stack_mask = (1 << sigstack_alignment) - 1; + signal_stack_size = (1 << sigstack_alignment) - teb_size; }
size = signal_stack_mask + 1; - if (!(status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, sigstack_zero_bits, - &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ))) + if (!(status = __wine_allocate_virtual_memory( NtCurrentProcess(), &addr, 0, + &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, + sigstack_alignment ))) { *teb = addr; (*teb)->Tib.Self = &(*teb)->Tib; diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 86398d8f54f..05355db8b71 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -1018,22 +1018,23 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) */ NTSTATUS signal_alloc_thread( TEB **teb ) { - static size_t sigstack_zero_bits; + static size_t sigstack_alignment; SIZE_T size; NTSTATUS status;
- if (!sigstack_zero_bits) + if (!sigstack_alignment) { size_t min_size = page_size; /* this is just for the TEB, we don't use a signal stack yet */ /* find the first power of two not smaller than min_size */ - while ((1u << sigstack_zero_bits) < min_size) sigstack_zero_bits++; + while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; assert( sizeof(TEB) <= min_size ); }
- size = 1 << sigstack_zero_bits; + size = 1 << sigstack_alignment; *teb = NULL; - if (!(status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)teb, sigstack_zero_bits, - &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ))) + if (!(status = __wine_allocate_virtual_memory( NtCurrentProcess(), (void **)teb, 0, + &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, + sigstack_alignment ))) { (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index c2151f78c63..c1dc6df1364 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -3263,24 +3263,25 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) */ NTSTATUS signal_alloc_thread( TEB **teb ) { - static size_t sigstack_zero_bits; + static size_t sigstack_alignment; SIZE_T size; NTSTATUS status;
- if (!sigstack_zero_bits) + if (!sigstack_alignment) { size_t min_size = teb_size + max( MINSIGSTKSZ, 8192 ); /* find the first power of two not smaller than min_size */ - sigstack_zero_bits = 12; - while ((1u << sigstack_zero_bits) < min_size) sigstack_zero_bits++; - signal_stack_size = (1 << sigstack_zero_bits) - teb_size; + sigstack_alignment = 12; + while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; + signal_stack_size = (1 << sigstack_alignment) - teb_size; assert( sizeof(TEB) <= teb_size ); }
- size = 1 << sigstack_zero_bits; + size = 1 << sigstack_alignment; *teb = NULL; - if (!(status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)teb, sigstack_zero_bits, - &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ))) + if (!(status = __wine_allocate_virtual_memory( NtCurrentProcess(), (void **)teb, 0, + &size, MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, + sigstack_alignment ))) { (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 46de839400d..a9f542b77fc 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -184,8 +184,8 @@ void thread_init(void)
addr = NULL; size = sizeof(*peb); - NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 1, &size, - MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE ); + __wine_allocate_virtual_memory( NtCurrentProcess(), &addr, 0, &size, + MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE, 1 ); peb = addr;
peb->FastPebLock = &peb_lock; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 78973a8cda4..bac1ea47f0d 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -2455,16 +2455,18 @@ void virtual_set_large_address_space(void)
/*********************************************************************** - * NtAllocateVirtualMemory (NTDLL.@) - * ZwAllocateVirtualMemory (NTDLL.@) + * __wine_allocate_virtual_memory (NTDLL.@) + * + * Same as NtAllocateVirtualMemory but with an alignment parameter */ -NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_bits, - SIZE_T *size_ptr, ULONG type, ULONG protect ) +NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret, ULONG zero_bits, + SIZE_T *size_ptr, ULONG type, ULONG protect, + ULONG alignment ) { void *base; unsigned int vprot; SIZE_T size = *size_ptr; - SIZE_T mask = get_mask( zero_bits ); + SIZE_T mask = get_mask( alignment ); NTSTATUS status = STATUS_SUCCESS; BOOL is_dos_memory = FALSE; struct file_view *view; @@ -2473,7 +2475,11 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ TRACE("%p %p %08lx %x %08x\n", process, *ret, size, type, protect );
if (!size) return STATUS_INVALID_PARAMETER; - if (!mask) return STATUS_INVALID_PARAMETER_3; + if (zero_bits) + { + FIXME("Unimplemented zero_bits handling\n"); + return STATUS_INVALID_PARAMETER_3; + }
if (process != NtCurrentProcess()) { @@ -2488,6 +2494,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ call.virtual_alloc.zero_bits = zero_bits; call.virtual_alloc.op_type = type; call.virtual_alloc.prot = protect; + call.virtual_alloc.alignment = alignment; status = server_queue_process_apc( process, &call, &result ); if (status != STATUS_SUCCESS) return status;
@@ -2590,6 +2597,17 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ }
+/*********************************************************************** + * NtAllocateVirtualMemory (NTDLL.@) + * ZwAllocateVirtualMemory (NTDLL.@) + */ +NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_bits, + SIZE_T *size_ptr, ULONG type, ULONG protect ) +{ + return __wine_allocate_virtual_memory( process, ret, zero_bits, size_ptr, type, protect, 0 ); +} + + /*********************************************************************** * NtFreeVirtualMemory (NTDLL.@) * ZwFreeVirtualMemory (NTDLL.@) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index a45d092deb1..a81edbcabb6 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -485,6 +485,7 @@ typedef union mem_size_t size; unsigned int zero_bits; unsigned int prot; + unsigned int alignment; } virtual_alloc; struct {
As for NtAllocateVirtualMemory, the parameter was misinterpreted as an alignment value. This wasn't used anywhere, so just add an explicit alignment parameter to internal virtual_map_section function and return an error when zero_bits is used.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/loader.c | 2 +- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/virtual.c | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 166066783ff..4807490be0c 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2101,7 +2101,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, if (!status) { status = virtual_map_section( mapping, module, 0, 0, NULL, &len, - PAGE_EXECUTE_READ, image_info ); + PAGE_EXECUTE_READ, image_info, 0 ); if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS; NtClose( mapping ); } diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index a629ea8751c..b4e7ae6aedb 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -173,7 +173,7 @@ extern NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret ULONG alignment ); extern NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG protect, - pe_image_info_t *image_info ) DECLSPEC_HIDDEN; + pe_image_info_t *image_info, ULONG alignment ) DECLSPEC_HIDDEN; extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_create_builtin_view( void *base ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index bac1ea47f0d..dfead5b2eea 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1609,12 +1609,12 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T m */ NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG protect, - pe_image_info_t *image_info ) + pe_image_info_t *image_info, ULONG alignment ) { NTSTATUS res; mem_size_t full_size; ACCESS_MASK access; - SIZE_T size, mask = get_mask( zero_bits ); + SIZE_T size, mask = get_mask( alignment ); int unix_handle = -1, needs_close; unsigned int vprot, sec_flags; struct file_view *view; @@ -3097,7 +3097,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p SECTION_INHERIT inherit, ULONG alloc_type, ULONG protect ) { NTSTATUS res; - SIZE_T mask = get_mask( zero_bits ); + SIZE_T mask = get_mask( 0 ); pe_image_info_t image_info; LARGE_INTEGER offset;
@@ -3108,8 +3108,11 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
/* Check parameters */
- if ((*addr_ptr && zero_bits) || !mask) + if (zero_bits) + { + FIXME("Unimplemented zero_bits handling\n"); return STATUS_INVALID_PARAMETER_4; + }
#ifndef _WIN64 if (!is_wow64 && (alloc_type & AT_ROUND_TO_PAGE)) @@ -3149,7 +3152,8 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p }
return virtual_map_section( handle, addr_ptr, zero_bits, commit_size, - offset_ptr, size_ptr, protect, &image_info ); + offset_ptr, size_ptr, protect, &image_info, + 0 ); }
Implement the correct zero_bits behavior for this single case: * Limit the search in reserved areas to the lower 2G range, * Pass the MAP_32BIT flag to mmap as a fallback.
LuaJIT <= v2.0.5 for example, when running in 64bit, allocates its memory in the lower 2GB memory region by using the zero_bits parameter.
This will fix this particular scenario, while trying to minimize the changes on all the other cases. --- dlls/kernel32/tests/virtual.c | 1 - dlls/ntdll/virtual.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 3e833dac2bc..36e56f9e49c 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -497,7 +497,6 @@ static void test_VirtualAlloc(void) zero_bits = 1; status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 1, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - todo_wine ok((status == STATUS_SUCCESS || broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */) && ((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, "NtAllocateVirtualMemory returned %08x, addr2: %p\n", status, addr2); diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index dfead5b2eea..52d4718e738 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1083,7 +1083,7 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot ) * The csVirtual section must be held by caller. */ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, size_t mask, - int top_down, unsigned int vprot ) + int top_down, unsigned int vprot, size_t zero_bits ) { void *ptr; NTSTATUS status; @@ -1100,11 +1100,25 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, { size_t view_size = size + mask + 1; struct alloc_area alloc; + int flags = 0;
alloc.size = size; alloc.mask = mask; alloc.top_down = top_down; + +#if defined(__x86_64__) && defined(MAP_32BIT) + /* HACK: only works for zero_bits == 1, this is a simple workaround + * for some 64bit code that tries to allocate memory in the lower + * 2GB segment using zero_bits parameter. + */ + assert(zero_bits <= 1); + alloc.limit = zero_bits ? (void*)(((~(UINT_PTR)0) >> (32 + zero_bits)) & ~0xffff) + : user_space_limit; + flags = MAP_32BIT; +#else alloc.limit = user_space_limit; +#endif + if (wine_mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down )) { ptr = alloc.result; @@ -1116,7 +1130,7 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
for (;;) { - if ((ptr = wine_anon_mmap( NULL, view_size, VIRTUAL_GetUnixProt(vprot), 0 )) == (void *)-1) + if ((ptr = wine_anon_mmap( NULL, view_size, VIRTUAL_GetUnixProt(vprot), flags )) == (void *)-1) { if (errno == ENOMEM) return STATUS_NO_MEMORY; return STATUS_INVALID_PARAMETER; @@ -1284,7 +1298,7 @@ static NTSTATUS allocate_dos_memory( struct file_view **view, unsigned int vprot if (addr != low_64k) { if (addr != (void *)-1) munmap( addr, dosmem_size - 0x10000 ); - return map_view( view, NULL, dosmem_size, 0xffff, 0, vprot ); + return map_view( view, NULL, dosmem_size, 0xffff, 0, vprot, 0 ); } }
@@ -1388,11 +1402,11 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T m
if (base >= (char *)address_space_start) /* make sure the DOS area remains free */ status = map_view( &view, base, total_size, mask, FALSE, SEC_IMAGE | SEC_FILE | - VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY ); + VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, 0 );
if (status != STATUS_SUCCESS) status = map_view( &view, NULL, total_size, mask, FALSE, SEC_IMAGE | SEC_FILE | - VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY ); + VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, 0 );
if (status != STATUS_SUCCESS) goto error;
@@ -1713,7 +1727,7 @@ NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, S get_vprot_flags( protect, &vprot, sec_flags & SEC_IMAGE ); vprot |= sec_flags; if (!(sec_flags & SEC_RESERVE)) vprot |= VPROT_COMMITTED; - res = map_view( &view, *addr_ptr, size, mask, FALSE, vprot ); + res = map_view( &view, *addr_ptr, size, mask, FALSE, vprot, 0 ); if (res) { server_leave_uninterrupted_section( &csVirtual, &sigset ); @@ -1946,7 +1960,7 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi server_enter_uninterrupted_section( &csVirtual, &sigset );
if ((status = map_view( &view, NULL, size + extra_size, 0xffff, 0, - VPROT_READ | VPROT_WRITE | VPROT_COMMITTED )) != STATUS_SUCCESS) + VPROT_READ | VPROT_WRITE | VPROT_COMMITTED, 0 )) != STATUS_SUCCESS) goto done;
#ifdef VALGRIND_STACK_REGISTER @@ -2475,7 +2489,11 @@ NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret, ULONG TRACE("%p %p %08lx %x %08x\n", process, *ret, size, type, protect );
if (!size) return STATUS_INVALID_PARAMETER; +#if defined(__x86_64__) && !defined(MAP_32BIT) if (zero_bits) +#else + if (zero_bits > 1) +#endif { FIXME("Unimplemented zero_bits handling\n"); return STATUS_INVALID_PARAMETER_3; @@ -2557,7 +2575,7 @@ NTSTATUS CDECL __wine_allocate_virtual_memory( HANDLE process, PVOID *ret, ULONG
if (vprot & VPROT_WRITECOPY) status = STATUS_INVALID_PAGE_PROTECTION; else if (is_dos_memory) status = allocate_dos_memory( &view, vprot ); - else status = map_view( &view, base, size, mask, type & MEM_TOP_DOWN, vprot ); + else status = map_view( &view, base, size, mask, type & MEM_TOP_DOWN, vprot, zero_bits );
if (status == STATUS_SUCCESS) base = view->base; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52886
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/kernel32/tests/virtual.c:497 error: patch failed: dlls/ntdll/virtual.c:2475 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/kernel32/tests/virtual.c:497 error: patch failed: dlls/ntdll/virtual.c:2475 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/kernel32/tests/virtual.c:497 error: patch failed: dlls/ntdll/virtual.c:2475 Task: Patch failed to apply
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52867
Your paranoid android.
=== wvistau64 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_zh_CN (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_fr (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_he (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w2008s64 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w7u (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w7pro64 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w8 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w8adm (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w864 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1507 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1809 (32 bit report) ===
kernel32: virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 0, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:2972: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2986: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3111: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3129: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3210: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3234: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2916: Test failed: expected policy flags 1, got 3 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3015: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3030: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3078: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3093: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3274: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3299: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2878: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2917: Test failed: expected policy permanent FALSE, got 1 virtual.c:3336: Test failed: NtSetInformationProcess failed with status c0000022
=== debian9 (32 bit report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit French report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit Japanese:Japan report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit Chinese:China report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (32 bit WoW report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000
=== debian9 (64 bit WoW report) ===
kernel32: virtual.c:467: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000 virtual.c:486: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000 virtual.c:503: Test succeeded inside todo block: NtAllocateVirtualMemory returned 00000000, addr2: 00223000