ntdll: Fix error code when querying too large memory address.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Michael Müller 2018-02-27 17:31:23 -06:00 committed by Alexandre Julliard
parent 1cee60d068
commit 556ba38dd1
2 changed files with 5 additions and 1 deletions

View File

@ -1868,6 +1868,10 @@ static void test_queryvirtualmemory(void)
"mbi.Protect is 0x%x\n", mbi.Protect);
}
else skip( "bss is outside of module\n" ); /* this can happen on Mac OS */
/* check error code when addr is higher than working set limit */
status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)~0, MemoryBasicInformation, &mbi, sizeof(mbi), &readcount);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
}
static void test_affinity(void)

View File

@ -2845,7 +2845,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
base = ROUND_ADDR( addr, page_mask );
if (is_beyond_limit( base, 1, working_set_limit )) return STATUS_WORKING_SET_LIMIT_RANGE;
if (is_beyond_limit( base, 1, working_set_limit )) return STATUS_INVALID_PARAMETER;
/* Find the view containing the address */