mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 06:50:30 +00:00
ntdll/tests: Add a test for the protection state of the read-write data section.
This commit is contained in:
parent
ed69ddb37e
commit
8e2e95ed7e
|
@ -1073,6 +1073,7 @@ static void test_queryvirtualmemory(void)
|
|||
NTSTATUS status;
|
||||
SIZE_T readcount;
|
||||
static const char teststring[] = "test string";
|
||||
static char datatestbuf[42] = "abc";
|
||||
static char rwtestbuf[42];
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
char stackbuf[42];
|
||||
|
@ -1112,7 +1113,15 @@ static void test_queryvirtualmemory(void)
|
|||
if (mbi.Protect != PAGE_READONLY)
|
||||
todo_wine ok( mbi.Protect == PAGE_READONLY, "mbi.Protect is 0x%x, expected 0x%X\n", mbi.Protect, PAGE_READONLY);
|
||||
|
||||
trace("Check flags of read-write global data (.bss) at %p\n", rwtestbuf);
|
||||
trace("Check flags of read-write data at %p\n", datatestbuf);
|
||||
status = pNtQueryVirtualMemory(NtCurrentProcess(), datatestbuf, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount);
|
||||
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
|
||||
ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount);
|
||||
ok (mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "mbi.AllocationProtect is 0x%x, expected 0x%x\n", mbi.AllocationProtect, PAGE_EXECUTE_WRITECOPY);
|
||||
ok (mbi.State == MEM_COMMIT, "mbi.State is 0x%x, expected 0x%X\n", mbi.State, MEM_COMMIT);
|
||||
ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected 0x%X\n", mbi.Protect, PAGE_READWRITE);
|
||||
|
||||
trace("Check flags of read-write uninitialized data (.bss) at %p\n", rwtestbuf);
|
||||
status = pNtQueryVirtualMemory(NtCurrentProcess(), rwtestbuf, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount);
|
||||
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
|
||||
ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount);
|
||||
|
|
Loading…
Reference in a new issue