kernel32/tests: Add more tests related to the zero_bits parameter.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2017-05-31 22:48:43 +09:00 committed by Alexandre Julliard
parent d968d32a1b
commit 5bd58bb275
1 changed files with 30 additions and 0 deletions

View File

@ -386,6 +386,24 @@ static void test_VirtualAlloc(void)
ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status);
if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n");
/* 21 zero bits is valid */
size = 0x1000;
addr2 = NULL;
status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 21, &size,
MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY,
"NtAllocateVirtualMemory returned %08x\n", status);
if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n");
/* 22 zero bits is invalid */
size = 0x1000;
addr2 = NULL;
status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 22, &size,
MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
todo_wine
ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status);
if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n");
/* AT_ROUND_TO_PAGE flag is not supported for VirtualAlloc */
SetLastError(0xdeadbeef);
addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE);
@ -1146,6 +1164,18 @@ static void test_NtMapViewOfSection(void)
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 );
todo_wine
ok( status == STATUS_INVALID_PARAMETER_4, "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;