Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernel32/tests/virtual.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 0b718606d0e..47e61566c9c 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1265,8 +1265,8 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - todo_wine - ok( status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, + "NtMapViewOfSection returned %x\n", status ); if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 ); @@ -1288,7 +1288,8 @@ static void test_NtMapViewOfSection(void) ptr2 = NULL; size = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %x\n", status ); if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 ); @@ -1328,25 +1329,30 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER || + broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, + "NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1001; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 1; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %x\n", status );
if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 ) || !is_wow64)) @@ -1409,7 +1415,8 @@ static void test_NtMapViewOfSection(void) status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); todo_wine - ok( status == STATUS_INVALID_PARAMETER_9, "NtMapViewOfSection returned %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_9 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %x\n", status ); }
status = pNtUnmapViewOfSection( hProcess, ptr );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernel32/tests/virtual.c | 159 ---------------------------- dlls/ntdll/tests/virtual.c | 188 ++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 159 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 47e61566c9c..4b37dbcadc5 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1260,165 +1260,6 @@ static void test_NtMapViewOfSection(void) ok( result == sizeof(buffer), "ReadProcessMemory didn't read all data (%lx)\n", result ); ok( !memcmp( buffer, data, sizeof(buffer) ), "Wrong data read\n" );
- /* for some unknown reason NtMapViewOfSection fails with STATUS_NO_MEMORY when zero_bits != 0 ? */ - ptr2 = NULL; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, - "NtMapViewOfSection returned %x\n", status ); - if (status == STATUS_SUCCESS) - { - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } - - ptr2 = NULL; - size = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - todo_wine - ok( status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %x\n", status ); - if (status == STATUS_SUCCESS) - { - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } - - /* 22 zero bits isn't acceptable */ - ptr2 = NULL; - size = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %x\n", status ); - if (status == STATUS_SUCCESS) - { - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } - - /* mapping at the same page conflicts */ - ptr2 = ptr; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %x\n", status ); - - /* offset has to be aligned */ - ptr2 = ptr; - size = 0; - offset.QuadPart = 1; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %x\n", status ); - - /* ptr has to be aligned */ - ptr2 = (char *)ptr + 42; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %x\n", status ); - - /* still not 64k aligned */ - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %x\n", status ); - - /* zero_bits != 0 is not allowed when an address is set */ - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER || - broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, - "NtMapViewOfSection returned %x\n", status ); - - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %x\n", status ); - - ptr2 = (char *)ptr + 0x1001; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %x\n", status ); - - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 1; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE ); - ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %x\n", status ); - - if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || - !pIsWow64Process( GetCurrentProcess(), &is_wow64 ) || !is_wow64)) - { - /* new memory region conflicts with previous mapping */ - ptr2 = ptr; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - ok( status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %x\n", status ); - - ptr2 = (char *)ptr + 42; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - ok( status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %x\n", status ); - - /* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */ - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - ok( (char *)ptr2 == (char *)ptr + 0x1000, - "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2 ); - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - - /* the address is rounded down if not on a page boundary */ - ptr2 = (char *)ptr + 0x1001; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - ok( (char *)ptr2 == (char *)ptr + 0x1000, - "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2 ); - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - - ptr2 = (char *)ptr + 0x2000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - ok( status == STATUS_SUCCESS, "NtMapViewOfSection returned %x\n", status ); - ok( (char *)ptr2 == (char *)ptr + 0x2000, - "expected address %p, got %p\n", (char *)ptr + 0x2000, ptr2 ); - status = pNtUnmapViewOfSection( hProcess, ptr2 ); - ok( !status, "NtUnmapViewOfSection failed status %x\n", status ); - } - else - { - ptr2 = (char *)ptr + 0x1000; - size = 0; - offset.QuadPart = 0; - status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 0, 0, &offset, - &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE ); - todo_wine - ok( status == STATUS_INVALID_PARAMETER_9 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %x\n", status ); - } - status = pNtUnmapViewOfSection( hProcess, ptr ); ok( !status, "NtUnmapViewOfSection failed status %x\n", status );
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index ff10508a604..26d058185fd 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -167,6 +167,193 @@ static void test_AllocateVirtualMemory(void) ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed\n"); }
+static void test_MapViewOfSection(void) +{ + HANDLE mapping, process = NtCurrentProcess(); + void *ptr, *ptr2; + BOOL is_wow64; + DWORD status; + SIZE_T size; + LARGE_INTEGER offset, map_size; + + map_size.QuadPart = 0x1000; + status = NtCreateSection(&mapping, SECTION_MAP_READ | SECTION_MAP_WRITE, NULL, + &map_size, PAGE_READWRITE, SEC_COMMIT, NULL); + ok(status == STATUS_SUCCESS, "NtCreateSection returned %08x\n", status); + ok(mapping != 0, "NtCreateSection failed\n"); + + ptr = NULL; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); + ok(!((ULONG_PTR)ptr & 0xffff), "returned memory %p is not aligned to 64k\n", ptr); + + /* for some unknown reason NtMapViewOfSection fails with STATUS_NO_MEMORY when zero_bits != 0 ? */ + ptr2 = NULL; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, + "NtMapViewOfSection returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + + ptr2 = NULL; + size = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + todo_wine + ok(status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + + /* 22 zero bits isn't acceptable */ + ptr2 = NULL; + size = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); + + /* mapping at the same page conflicts */ + ptr2 = ptr; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status); + + /* offset has to be aligned */ + ptr2 = ptr; + size = 0; + offset.QuadPart = 1; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status); + + /* ptr has to be aligned */ + ptr2 = (char *)ptr + 42; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status); + + /* still not 64k aligned */ + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status); + + /* zero_bits != 0 is not allowed when an address is set */ + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER || + broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, + "NtMapViewOfSection returned %08x\n", status); + + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); + + ptr2 = (char *)ptr + 0x1001; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); + + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 1; + status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); + + if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || + !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + { + /* new memory region conflicts with previous mapping */ + ptr2 = ptr; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status); + + ptr2 = (char *)ptr + 42; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status); + + /* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */ + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); + ok((char *)ptr2 == (char *)ptr + 0x1000, + "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2); + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + + /* the address is rounded down if not on a page boundary */ + ptr2 = (char *)ptr + 0x1001; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); + ok((char *)ptr2 == (char *)ptr + 0x1000, + "expected address %p, got %p\n", (char *)ptr + 0x1000, ptr2); + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + + ptr2 = (char *)ptr + 0x2000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); + ok((char *)ptr2 == (char *)ptr + 0x2000, + "expected address %p, got %p\n", (char *)ptr + 0x2000, ptr2); + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + else + { + ptr2 = (char *)ptr + 0x1000; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); + todo_wine + ok(status == STATUS_INVALID_PARAMETER_9 || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + } + + status = NtUnmapViewOfSection(process, ptr); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + + NtClose(mapping); +} + START_TEST(virtual) { SYSTEM_BASIC_INFORMATION sbi; @@ -179,4 +366,5 @@ START_TEST(virtual) trace("system page size %#x\n", sbi.PageSize);
test_AllocateVirtualMemory(); + test_MapViewOfSection(); }
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=53703
Your paranoid android.
=== wvistau64 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_zh_CN (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_fr (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_he (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w2008s64 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w7u (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w7pro64 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w8 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w8adm (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w864 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1507 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1809 (32 bit report) ===
kernel32: virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 0, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2698: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2712: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2837: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2855: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2936: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2960: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2642: Test failed: expected policy flags 1, got 3 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:2741: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2756: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2804: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2819: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3000: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3025: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2604: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2643: Test failed: expected policy permanent FALSE, got 1 virtual.c:3062: Test failed: NtSetInformationProcess failed with status c0000022
On Fri, Jun 14, 2019 at 03:11:11PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/kernel32/tests/virtual.c | 159 ---------------------------- dlls/ntdll/tests/virtual.c | 188 ++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 159 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 47e61566c9c..4b37dbcadc5 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1260,165 +1260,6 @@ static void test_NtMapViewOfSection(void) ok( result == sizeof(buffer), "ReadProcessMemory didn't read all data (%lx)\n", result ); ok( !memcmp( buffer, data, sizeof(buffer) ), "Wrong data read\n" );
Let's move all of test_NtMapViewOfSection to the ntdll tests and keep their cross-process nature too.
Huw.
On Mon, 2019-06-17 at 10:41 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:11PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/kernel32/tests/virtual.c | 159 ---------------------------- dlls/ntdll/tests/virtual.c | 188 ++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 159 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 47e61566c9c..4b37dbcadc5 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1260,165 +1260,6 @@ static void test_NtMapViewOfSection(void) ok( result == sizeof(buffer), "ReadProcessMemory didn't read all data (%lx)\n", result ); ok( !memcmp( buffer, data, sizeof(buffer) ), "Wrong data read\n" );
Let's move all of test_NtMapViewOfSection to the ntdll tests and keep their cross-process nature too.
Huw.
The idea was to keep ReadProcessMemory test in kernel32 as it belongs to it, and make all ntdll tests using ntdll functions only. Plus the zero bits tests don't really have anything to do with cross process.
On Mon, Jun 17, 2019 at 11:52:15AM +0200, Rémi Bernon wrote:
On Mon, 2019-06-17 at 10:41 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:11PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/kernel32/tests/virtual.c | 159 ---------------------------- dlls/ntdll/tests/virtual.c | 188 ++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 159 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 47e61566c9c..4b37dbcadc5 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1260,165 +1260,6 @@ static void test_NtMapViewOfSection(void) ok( result == sizeof(buffer), "ReadProcessMemory didn't read all data (%lx)\n", result ); ok( !memcmp( buffer, data, sizeof(buffer) ), "Wrong data read\n" );
Let's move all of test_NtMapViewOfSection to the ntdll tests and keep their cross-process nature too.
Huw.
The idea was to keep ReadProcessMemory test in kernel32 as it belongs to it, and make all ntdll tests using ntdll functions only. Plus the zero bits tests don't really have anything to do with cross process.
The test is really about whether NtMapViewOfSection() can create a cross-process view. ReadProcessMemory() is used to test that. Moving to ntdll and using NtReadVirtualMemory() will keep the tests together.
Yes, if you want to make the zero_bits stuff process local, that's ok, but once the cross-process stuff is in place it's almost easier just to use it.
Huw.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 75 +++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 25 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 26d058185fd..2a71a561a90 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -39,21 +39,24 @@ static void test_AllocateVirtualMemory(void) /* simple allocation should success */ size = 0x1000; addr1 = NULL; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, + zero_bits = 0; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08x\n", status);
/* allocation conflicts because of 64k align */ size = 0x1000; addr2 = (char *)addr1 + 0x1000; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size, + zero_bits = 0; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status);
/* it should conflict, even when zero_bits is explicitly set */ size = 0x1000; addr2 = (char *)addr1 + 0x1000; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 12, &size, + zero_bits = 12; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) @@ -67,7 +70,7 @@ static void test_AllocateVirtualMemory(void) size = 0x1000; addr2 = NULL; zero_bits = 1; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 1, &size, + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */, @@ -106,7 +109,8 @@ static void test_AllocateVirtualMemory(void) /* 21 zero bits never succeeds */ size = 0x1000; addr2 = NULL; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 21, &size, + zero_bits = 21; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); todo_wine ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER, @@ -121,7 +125,8 @@ static void test_AllocateVirtualMemory(void) /* 22 zero bits is invalid */ size = 0x1000; addr2 = NULL; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 22, &size, + zero_bits = 22; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_3 || status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemory returned %08x\n", status); @@ -157,7 +162,8 @@ static void test_AllocateVirtualMemory(void) /* AT_ROUND_TO_PAGE flag is not supported for NtAllocateVirtualMemory */ size = 0x1000; addr2 = (char *)addr1 + 0x1000; - status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size, + zero_bits = 0; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_5 || status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemory returned %08x\n", status); @@ -175,6 +181,7 @@ static void test_MapViewOfSection(void) DWORD status; SIZE_T size; LARGE_INTEGER offset, map_size; + ULONG zero_bits;
map_size.QuadPart = 0x1000; status = NtCreateSection(&mapping, SECTION_MAP_READ | SECTION_MAP_WRITE, NULL, @@ -184,16 +191,18 @@ static void test_MapViewOfSection(void)
ptr = NULL; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); ok(!((ULONG_PTR)ptr & 0xffff), "returned memory %p is not aligned to 64k\n", ptr);
/* for some unknown reason NtMapViewOfSection fails with STATUS_NO_MEMORY when zero_bits != 0 ? */ ptr2 = NULL; size = 0; + zero_bits = 12; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) @@ -204,7 +213,8 @@ static void test_MapViewOfSection(void)
ptr2 = NULL; size = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + zero_bits = 16; + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); todo_wine ok(status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) @@ -216,65 +226,74 @@ static void test_MapViewOfSection(void) /* 22 zero bits isn't acceptable */ ptr2 = NULL; size = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE); + zero_bits = 22; + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, "NtMapViewOfSection returned %08x\n", status);
/* mapping at the same page conflicts */ ptr2 = ptr; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
/* offset has to be aligned */ ptr2 = ptr; size = 0; + zero_bits = 0; offset.QuadPart = 1; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
/* ptr has to be aligned */ ptr2 = (char *)ptr + 42; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
/* still not 64k aligned */ ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_MAPPED_ALIGNMENT, "NtMapViewOfSection returned %08x\n", status);
/* zero_bits != 0 is not allowed when an address is set */ ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 12; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER || broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, "NtMapViewOfSection returned %08x\n", status);
ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 16; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, "NtMapViewOfSection returned %08x\n", status);
ptr2 = (char *)ptr + 0x1001; size = 0; + zero_bits = 16; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, "NtMapViewOfSection returned %08x\n", status);
ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 16; offset.QuadPart = 1; - status = NtMapViewOfSection(mapping, process, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, "NtMapViewOfSection returned %08x\n", status);
@@ -284,23 +303,26 @@ static void test_MapViewOfSection(void) /* new memory region conflicts with previous mapping */ ptr2 = ptr; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
ptr2 = (char *)ptr + 42; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); ok(status == STATUS_CONFLICTING_ADDRESSES, "NtMapViewOfSection returned %08x\n", status);
/* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */ ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); ok((char *)ptr2 == (char *)ptr + 0x1000, @@ -311,8 +333,9 @@ static void test_MapViewOfSection(void) /* the address is rounded down if not on a page boundary */ ptr2 = (char *)ptr + 0x1001; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); ok((char *)ptr2 == (char *)ptr + 0x1000, @@ -322,8 +345,9 @@ static void test_MapViewOfSection(void)
ptr2 = (char *)ptr + 0x2000; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); ok((char *)ptr2 == (char *)ptr + 0x2000, @@ -335,8 +359,9 @@ static void test_MapViewOfSection(void) { ptr2 = (char *)ptr + 0x1000; size = 0; + zero_bits = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, 0, 0, &offset, + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, AT_ROUND_TO_PAGE, PAGE_READWRITE); todo_wine ok(status == STATUS_INVALID_PARAMETER_9 || status == STATUS_INVALID_PARAMETER,
On Fri, Jun 14, 2019 at 03:11:12PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/ntdll/tests/virtual.c | 75 +++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 25 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 26d058185fd..2a71a561a90 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -39,21 +39,24 @@ static void test_AllocateVirtualMemory(void) /* simple allocation should success */ size = 0x1000; addr1 = NULL;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size,
- zero_bits = 0;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
Does this really make things better? If you follow this logic through you'll be creating a variable for every parameter and initialising it before each call.
Huw.
On Mon, 2019-06-17 at 10:45 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:12PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/ntdll/tests/virtual.c | 75 +++++++++++++++++++++++++---------
1 file changed, 50 insertions(+), 25 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 26d058185fd..2a71a561a90 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -39,21 +39,24 @@ static void test_AllocateVirtualMemory(void) /* simple allocation should success */ size = 0x1000; addr1 = NULL;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1,
0, &size,
- zero_bits = 0;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1,
zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
Does this really make things better? If you follow this logic through you'll be creating a variable for every parameter and initialising it before each call.
Huw.
There was one tests where a value was passed to the function and then the address result was checked using the local variable. I just wanted to avoid this kind of typo.
On Mon, Jun 17, 2019 at 11:49:59AM +0200, Rémi Bernon wrote:
On Mon, 2019-06-17 at 10:45 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:12PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/ntdll/tests/virtual.c | 75 +++++++++++++++++++++++++---------
1 file changed, 50 insertions(+), 25 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 26d058185fd..2a71a561a90 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -39,21 +39,24 @@ static void test_AllocateVirtualMemory(void) /* simple allocation should success */ size = 0x1000; addr1 = NULL;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1,
0, &size,
- zero_bits = 0;
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1,
zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
Does this really make things better? If you follow this logic through you'll be creating a variable for every parameter and initialising it before each call.
Huw.
There was one tests where a value was passed to the function and then the address result was checked using the local variable. I just wanted to avoid this kind of typo.
Ah, I see. In that case let's just use the variable for the cases where we're actaully testing zero_bits behaviour (most likely when it's non-zero). Otherwise just pass 0 directly to the function.
Huw.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 89 +++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 29 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 2a71a561a90..c02dbd88a54 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -197,40 +197,95 @@ static void test_MapViewOfSection(void) ok(status == STATUS_SUCCESS, "NtMapViewOfSection returned %08x\n", status); ok(!((ULONG_PTR)ptr & 0xffff), "returned memory %p is not aligned to 64k\n", ptr);
- /* for some unknown reason NtMapViewOfSection fails with STATUS_NO_MEMORY when zero_bits != 0 ? */ + /* 1 zero bits should zero 63-31 upper bits */ ptr2 = NULL; size = 0; - zero_bits = 12; + zero_bits = 1; offset.QuadPart = 0; status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { + todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, + "NtMapViewOfSection returned address: %p\n", ptr2); + status = NtUnmapViewOfSection(process, ptr2); ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); }
+ for (zero_bits = 2; zero_bits <= 20; zero_bits++) + { + ptr2 = NULL; + size = 0; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, + "NtMapViewOfSection with %d zero_bits returned %08x\n", zero_bits, status); + if (status == STATUS_SUCCESS) + { + todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, + "NtMapViewOfSection with %d zero_bits returned address %p\n", zero_bits, ptr2); + + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + } + + /* 21 zero bits never succeeds */ ptr2 = NULL; size = 0; - zero_bits = 16; + zero_bits = 21; + offset.QuadPart = 0; status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); todo_wine - ok(status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); + ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER, + "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { status = NtUnmapViewOfSection(process, ptr2); ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); }
- /* 22 zero bits isn't acceptable */ + /* 22 zero bits is invalid */ ptr2 = NULL; size = 0; zero_bits = 22; + offset.QuadPart = 0; status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, "NtMapViewOfSection returned %08x\n", status);
+ /* zero bits > 31 should be considered as bitmask on 64bit and WoW64 */ + ptr2 = NULL; + size = 0; + zero_bits = 0x1fffffff; + offset.QuadPart = 0; + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + + if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || + !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + { + ok(status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %08x\n", status); + } + else + { + todo_wine + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, + "NtMapViewOfSection returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + todo_wine_if((UINT_PTR)ptr2 & ~zero_bits) + ok(((UINT_PTR)ptr2 & ~zero_bits) == 0, + "NtMapViewOfSection returned address %p\n", ptr2); + + status = NtUnmapViewOfSection(process, ptr2); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08x\n", status); + } + } + /* mapping at the same page conflicts */ ptr2 = ptr; size = 0; @@ -273,30 +328,6 @@ static void test_MapViewOfSection(void) broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, "NtMapViewOfSection returned %08x\n", status);
- ptr2 = (char *)ptr + 0x1000; - size = 0; - zero_bits = 16; - offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); - ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %08x\n", status); - - ptr2 = (char *)ptr + 0x1001; - size = 0; - zero_bits = 16; - offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); - ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %08x\n", status); - - ptr2 = (char *)ptr + 0x1000; - size = 0; - zero_bits = 16; - offset.QuadPart = 1; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); - ok(status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER, - "NtMapViewOfSection returned %08x\n", status); - if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) {
See 00451d5edf9a13fd8f414a0d06869e38cf66b754
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 1 - dlls/ntdll/virtual.c | 34 ++++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index c02dbd88a54..8693194ae84 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -272,7 +272,6 @@ static void test_MapViewOfSection(void) } else { - todo_wine ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 86377af0a8c..3c978b266d8 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -409,12 +409,12 @@ static struct file_view *VIRTUAL_FindView( const void *addr, size_t size ) /*********************************************************************** * get_mask */ -static inline UINT_PTR get_mask( ULONG zero_bits ) +static inline UINT_PTR get_mask( ULONG alignment ) { - if (!zero_bits) return 0xffff; /* allocations are aligned to 64K by default */ - if (zero_bits < page_shift) zero_bits = page_shift; - if (zero_bits > 21) return 0; - return (1 << zero_bits) - 1; + if (!alignment) return 0xffff; /* allocations are aligned to 64K by default */ + if (alignment < page_shift) alignment = page_shift; + if (alignment > 21) return 0; + return (1 << alignment) - 1; }
@@ -1361,7 +1361,8 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable ) * Map an executable (PE format) image into memory. */ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T mask, - pe_image_info_t *image_info, int shared_fd, BOOL removable, PVOID *addr_ptr ) + pe_image_info_t *image_info, int shared_fd, BOOL removable, + PVOID *addr_ptr, SIZE_T zero_bits ) { IMAGE_DOS_HEADER *dos; IMAGE_NT_HEADERS *nt; @@ -1391,11 +1392,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, 0 ); + VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits );
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, 0 ); + VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits );
if (status != STATUS_SUCCESS) goto error;
@@ -1617,7 +1618,7 @@ NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, S NTSTATUS res; mem_size_t full_size; ACCESS_MASK access; - SIZE_T size, mask = get_mask( zero_bits ); + SIZE_T size, mask = get_mask( 0 ); int unix_handle = -1, needs_close; unsigned int vprot, sec_flags; struct file_view *view; @@ -1673,13 +1674,14 @@ NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, S if ((res = server_get_unix_fd( shared_file, FILE_READ_DATA|FILE_WRITE_DATA, &shared_fd, &shared_needs_close, NULL, NULL ))) goto done; res = map_image( handle, access, unix_handle, mask, image_info, - shared_fd, needs_close, addr_ptr ); + shared_fd, needs_close, addr_ptr, zero_bits ); if (shared_needs_close) close( shared_fd ); close_handle( shared_file ); } else { - res = map_image( handle, access, unix_handle, mask, image_info, -1, needs_close, addr_ptr ); + res = map_image( handle, access, unix_handle, mask, image_info, + -1, needs_close, addr_ptr, zero_bits ); } if (needs_close) close( unix_handle ); if (res >= 0) *size_ptr = image_info->map_size; @@ -1716,7 +1718,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, 0 ); + res = map_view( &view, *addr_ptr, size, mask, FALSE, vprot, zero_bits ); if (res) { server_leave_uninterrupted_section( &csVirtual, &sigset ); @@ -3098,7 +3100,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,9 +3110,9 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p handle, process, *addr_ptr, offset.u.HighPart, offset.u.LowPart, *size_ptr, protect );
/* Check parameters */ - - if ((*addr_ptr && zero_bits) || !mask) - return STATUS_INVALID_PARAMETER_4; + if (*addr_ptr && zero_bits) return STATUS_INVALID_PARAMETER_4; + if (zero_bits > 21 && zero_bits < 32) return STATUS_INVALID_PARAMETER_4; + if (!is_win64 && !is_wow64 && zero_bits >= 32) return STATUS_INVALID_PARAMETER_4;
#ifndef _WIN64 if (!is_wow64 && (alloc_type & AT_ROUND_TO_PAGE))
On Fri, Jun 14, 2019 at 03:11:14PM +0200, Rémi Bernon wrote:
static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T mask,
pe_image_info_t *image_info, int shared_fd, BOOL removable, PVOID *addr_ptr )
pe_image_info_t *image_info, int shared_fd, BOOL removable,
PVOID *addr_ptr, SIZE_T zero_bits )
map_image() doesn't need the mask parameter anymore. Just call map_view() with get_mask(0).
On a related note, it might prehaps be cleaner to have map_view() take an alignment parameter rather than the mask (that would be changed in a separate patch).
Huw.
NtMapViewOfSection also accepts the MEM_TOP_DOWN parameter that can be used in combination with zero_bits to map memory on the highest possible address.
This is useful for the subsequent patches so we can consistently fail zero_bits tests.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/loader.c | 2 +- dlls/ntdll/ntdll_misc.h | 4 ++-- dlls/ntdll/virtual.c | 25 ++++++++++++++----------- 3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 3f422a9c0be..487b752b499 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2135,7 +2135,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, *module = NULL; } status = virtual_map_section( mapping, module, 0, 0, NULL, &len, - PAGE_EXECUTE_READ, image_info ); + 0, PAGE_EXECUTE_READ, image_info ); 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 f8c377e6010..73e35435e72 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -171,8 +171,8 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S extern NTSTATUS virtual_alloc_aligned( PVOID *ret, ULONG zero_bits, SIZE_T *size_ptr, ULONG type, ULONG protect, ULONG alignment ) DECLSPEC_HIDDEN; 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; + const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type, + ULONG protect, pe_image_info_t *image_info ) 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 3c978b266d8..29a7c96c599 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1362,7 +1362,7 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable ) */ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T mask, pe_image_info_t *image_info, int shared_fd, BOOL removable, - PVOID *addr_ptr, SIZE_T zero_bits ) + PVOID *addr_ptr, SIZE_T zero_bits, ULONG alloc_type ) { IMAGE_DOS_HEADER *dos; IMAGE_NT_HEADERS *nt; @@ -1391,12 +1391,14 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T m server_enter_uninterrupted_section( &csVirtual, &sigset );
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, zero_bits ); + status = map_view( &view, base, total_size, mask, alloc_type & MEM_TOP_DOWN, + SEC_IMAGE | SEC_FILE | VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, + zero_bits );
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, zero_bits ); + status = map_view( &view, NULL, total_size, mask, alloc_type & MEM_TOP_DOWN, + SEC_IMAGE | SEC_FILE | VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, + zero_bits );
if (status != STATUS_SUCCESS) goto error;
@@ -1612,8 +1614,8 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, SIZE_T m * Map a file section into memory. */ 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 ) + const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type, + ULONG protect, pe_image_info_t *image_info ) { NTSTATUS res; mem_size_t full_size; @@ -1674,14 +1676,14 @@ NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, S if ((res = server_get_unix_fd( shared_file, FILE_READ_DATA|FILE_WRITE_DATA, &shared_fd, &shared_needs_close, NULL, NULL ))) goto done; res = map_image( handle, access, unix_handle, mask, image_info, - shared_fd, needs_close, addr_ptr, zero_bits ); + shared_fd, needs_close, addr_ptr, zero_bits, alloc_type ); if (shared_needs_close) close( shared_fd ); close_handle( shared_file ); } else { res = map_image( handle, access, unix_handle, mask, image_info, - -1, needs_close, addr_ptr, zero_bits ); + -1, needs_close, addr_ptr, zero_bits, alloc_type ); } if (needs_close) close( unix_handle ); if (res >= 0) *size_ptr = image_info->map_size; @@ -1718,7 +1720,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, zero_bits ); + res = map_view( &view, *addr_ptr, size, mask, alloc_type & MEM_TOP_DOWN, vprot, zero_bits ); if (res) { server_leave_uninterrupted_section( &csVirtual, &sigset ); @@ -3152,7 +3154,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, alloc_type, protect, + &image_info ); }
This is in order to use todo_wine_if(is_win64) in next patch.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 8693194ae84..a338bf1db09 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -27,6 +27,7 @@ #include "wine/test.h"
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); +const BOOL is_win64 = sizeof(void*) > sizeof(int);
static void test_AllocateVirtualMemory(void) { @@ -36,6 +37,8 @@ static void test_AllocateVirtualMemory(void) ULONG zero_bits; BOOL is_wow64;
+ if (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64)) is_wow64 = FALSE; + /* simple allocation should success */ size = 0x1000; addr1 = NULL; @@ -138,8 +141,7 @@ static void test_AllocateVirtualMemory(void) status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
- if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || - !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + if (!is_win64 && !is_wow64) { ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status); } @@ -183,6 +185,8 @@ static void test_MapViewOfSection(void) LARGE_INTEGER offset, map_size; ULONG zero_bits;
+ if (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64)) is_wow64 = FALSE; + map_size.QuadPart = 0x1000; status = NtCreateSection(&mapping, SECTION_MAP_READ | SECTION_MAP_WRITE, NULL, &map_size, PAGE_READWRITE, SEC_COMMIT, NULL); @@ -265,8 +269,7 @@ static void test_MapViewOfSection(void) offset.QuadPart = 0; status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE);
- if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || - !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + if (!is_win64 && !is_wow64) { ok(status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %08x\n", status); } @@ -327,8 +330,7 @@ static void test_MapViewOfSection(void) broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */, "NtMapViewOfSection returned %08x\n", status);
- if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || - !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + if (!is_win64 && !is_wow64) { /* new memory region conflicts with previous mapping */ ptr2 = ptr;
The todo_wine_if made the tests not really test anything, and one test was succeeding when it shouldn't. Now we can actually remove the todo when 1 zero_bits handling is implemented.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index a338bf1db09..f7fde7c6550 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -74,12 +74,14 @@ static void test_AllocateVirtualMemory(void) addr2 = NULL; zero_bits = 1; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */, "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) { + todo_wine_if(is_win64) ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, "NtAllocateVirtualMemory returned address: %p\n", addr2);
@@ -93,13 +95,14 @@ static void test_AllocateVirtualMemory(void) size = 0x1000; addr2 = NULL; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || broken(zero_bits == 20 && status == STATUS_CONFLICTING_ADDRESSES) /* w1064v1809 */, "NtAllocateVirtualMemory with %d zero_bits returned %08x\n", zero_bits, status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)addr2 >> (32 - zero_bits)) + todo_wine ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, "NtAllocateVirtualMemory with %d zero_bits returned address %p\n", zero_bits, addr2);
@@ -139,7 +142,8 @@ static void test_AllocateVirtualMemory(void) addr2 = NULL; zero_bits = 0x1fffffff; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE);
if (!is_win64 && !is_wow64) { @@ -151,7 +155,7 @@ static void test_AllocateVirtualMemory(void) "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)addr2 & ~zero_bits) + todo_wine ok(((UINT_PTR)addr2 & ~zero_bits) == 0, "NtAllocateVirtualMemory returned address %p\n", addr2);
@@ -206,12 +210,12 @@ static void test_MapViewOfSection(void) size = 0; zero_bits = 1; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + todo_wine_if(is_win64) ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, "NtMapViewOfSection returned address: %p\n", ptr2);
@@ -224,12 +228,12 @@ static void test_MapViewOfSection(void) ptr2 = NULL; size = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection with %d zero_bits returned %08x\n", zero_bits, status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + todo_wine ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, "NtMapViewOfSection with %d zero_bits returned address %p\n", zero_bits, ptr2);
@@ -267,7 +271,7 @@ static void test_MapViewOfSection(void) size = 0; zero_bits = 0x1fffffff; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE);
if (!is_win64 && !is_wow64) { @@ -279,7 +283,7 @@ static void test_MapViewOfSection(void) "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 & ~zero_bits) + todo_wine ok(((UINT_PTR)ptr2 & ~zero_bits) == 0, "NtMapViewOfSection returned address %p\n", ptr2);
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=53702
Your paranoid android.
=== wvistau64 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_zh_CN (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_fr (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_he (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w2008s64 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w7u (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w7pro64 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w8 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w8adm (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w864 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1507 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064v1809 (32 bit report) ===
kernel32: virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 0, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2857: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2871: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2996: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3014: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3095: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3119: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2801: Test failed: expected policy flags 1, got 3 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:2900: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2915: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2963: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:2978: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3159: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3184: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2763: Test failed: NtSetInformationProcess failed with status c0000022 virtual.c:2802: Test failed: expected policy permanent FALSE, got 1 virtual.c:3221: Test failed: NtSetInformationProcess failed with status c0000022
On Fri, Jun 14, 2019 at 03:11:10PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/kernel32/tests/virtual.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 0b718606d0e..47e61566c9c 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1265,8 +1265,8 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
So this is trying to map a view into the lowest 1MB of the addr space, wich is unlikely to succeed. Let's change the '12' to a '1' in this patch since that's what you did in [4/8] anyway.
- todo_wine
- ok( status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %x\n", status );
- ok( status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 );"NtMapViewOfSection returned %x\n", status );
@@ -1288,7 +1288,8 @@ static void test_NtMapViewOfSection(void) ptr2 = NULL; size = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 );"NtMapViewOfSection returned %x\n", status );
@@ -1328,25 +1329,30 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
Also, changing this and the other non-zero zero_bits below to '1' would improve the tests. i.e. it's something that one would expect to succeed if ptr2 was set to NULL.
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER ||
broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809 inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1001; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 1; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status == STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
Huw.
On Mon, 2019-06-17 at 10:39 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:10PM +0200, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/kernel32/tests/virtual.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 0b718606d0e..47e61566c9c 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1265,8 +1265,8 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
So this is trying to map a view into the lowest 1MB of the addr space, wich is unlikely to succeed. Let's change the '12' to a '1' in this patch since that's what you did in [4/8] anyway.
- todo_wine
- ok( status == STATUS_NO_MEMORY, "NtMapViewOfSection returned
%x\n", status );
- ok( status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 );"NtMapViewOfSection returned %x\n", status );
@@ -1288,7 +1288,8 @@ static void test_NtMapViewOfSection(void) ptr2 = NULL; size = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 22, 0, &offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection
returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status ==
STATUS_INVALID_PARAMETER,
if (status == STATUS_SUCCESS) { status = pNtUnmapViewOfSection( hProcess, ptr2 );"NtMapViewOfSection returned %x\n", status );
@@ -1328,25 +1329,30 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
Also, changing this and the other non-zero zero_bits below to '1' would improve the tests. i.e. it's something that one would expect to succeed if ptr2 was set to NULL.
After doing some testing it looks like it would change the test results as well. The comment here is wrong in the sense that it looks like Windows returns INVALID_PARAMETER whenever the fixed address parameter does not satisfy the provided zero_bits constraint. Whenever it does, then the tests fail with MAPPED_ALIGNMENT instead.
So with 12 or more zero bits, there was little chance for the provided address to ever satisfy the check, and INVALID_PARAMETER was returned. If we change it to 1 zero bit, then the tests will usually succeed.
This also explains the "broken" behaviour that was sometimes seen on w1064v1809.
This first patch was merely to add results seen on w1064v1809, and I didn't want to change test logic before moving them to ntdll. I can do the logic changes before moving the tests, but I don't think doing logic changes both before and after moving them is very clear.
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection
returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status ==
STATUS_INVALID_PARAMETER ||
broken(STATUS_MAPPED_ALIGNMENT) /* w1064v1809
inconsistently returns STATUS_MAPPED_ALIGNMENT or STATUS_INVALID_PARAMETER */,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0,
&offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection
returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status ==
STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1001; size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0,
&offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection
returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status ==
STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
ptr2 = (char *)ptr + 0x1000; size = 0; offset.QuadPart = 1; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0,
&offset, &size, 1, 0, PAGE_READWRITE );
- ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection
returned %x\n", status );
- ok( status == STATUS_INVALID_PARAMETER_4 || status ==
STATUS_INVALID_PARAMETER,
"NtMapViewOfSection returned %x\n", status );
Huw.
On Tue, Jun 18, 2019 at 12:34:07PM +0200, Rémi Bernon wrote:
On Mon, 2019-06-17 at 10:39 +0100, Huw Davies wrote:
On Fri, Jun 14, 2019 at 03:11:10PM +0200, Rémi Bernon wrote:
@@ -1328,25 +1329,30 @@ static void test_NtMapViewOfSection(void) size = 0; offset.QuadPart = 0; status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
Also, changing this and the other non-zero zero_bits below to '1' would improve the tests. i.e. it's something that one would expect to succeed if ptr2 was set to NULL.
After doing some testing it looks like it would change the test results as well. The comment here is wrong in the sense that it looks like Windows returns INVALID_PARAMETER whenever the fixed address parameter does not satisfy the provided zero_bits constraint. Whenever it does, then the tests fail with MAPPED_ALIGNMENT instead.
So with 12 or more zero bits, there was little chance for the provided address to ever satisfy the check, and INVALID_PARAMETER was returned. If we change it to 1 zero bit, then the tests will usually succeed.
This also explains the "broken" behaviour that was sometimes seen on w1064v1809.
This first patch was merely to add results seen on w1064v1809, and I didn't want to change test logic before moving them to ntdll. I can do the logic changes before moving the tests, but I don't think doing logic changes both before and after moving them is very clear.
The idea is to fix the tests before moving them. So yes, making these changes first makes sense.
Huw.