kernel32/tests: Don't hardcode page size in buffer size.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
Eric Pouech 2024-11-04 12:14:12 +01:00 committed by Alexandre Julliard
parent 52838daec5
commit b5be39cfb8
Notes: Alexandre Julliard 2024-11-12 22:01:31 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6767

View file

@ -4368,13 +4368,15 @@ static void test_PrefetchVirtualMemory(void)
static void test_ReadProcessMemory(void)
{
BYTE buf[0x2000];
BYTE *buf;
DWORD old_prot;
SIZE_T copied;
HANDLE hproc;
void *ptr;
BOOL ret;
buf = malloc(2 * si.dwPageSize);
ok(buf != NULL, "OOM\n");
ret = DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
&hproc, 0, FALSE, DUPLICATE_SAME_ACCESS);
ok(ret, "DuplicateHandle failed %lu\n", GetLastError());
@ -4403,6 +4405,7 @@ static void test_ReadProcessMemory(void)
ret = VirtualFree(ptr, 0, MEM_RELEASE);
ok(ret, "VirtualFree failed %lu\n", GetLastError());
CloseHandle(hproc);
free(buf);
}
START_TEST(virtual)