From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/ntdll/tests/info.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 7741293d815..d7b84f43b70 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -2949,6 +2949,7 @@ static void test_queryvirtualmemory(void) MEMORY_BASIC_INFORMATION mbi; char stackbuf[42]; HMODULE module; + HANDLE process; void *user_shared_data = (void *)0x7ffe0000; void *buffer[256]; MEMORY_SECTION_NAME *name = (MEMORY_SECTION_NAME *)buffer; @@ -2964,6 +2965,16 @@ static void test_queryvirtualmemory(void) ok (mbi.Protect == PAGE_READONLY, "mbi.Protect is 0x%lx, expected 0x%x\n", mbi.Protect, PAGE_READONLY); ok (mbi.Type == MEM_IMAGE, "mbi.Type is 0x%lx, expected 0x%x\n", mbi.Type, MEM_IMAGE);
+ module = GetModuleHandleA( "ntdll.dll" ); + process = NULL; + status = NtDuplicateObject(NtCurrentProcess(), NtCurrentProcess(), NtCurrentProcess(), + &process, PROCESS_VM_OPERATION | PROCESS_VM_WRITE, 0, 0); + ok(status == STATUS_SUCCESS, "DuplicateHandle failed\n"); + status = pNtQueryVirtualMemory(process, module, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); + todo_wine + ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); + CloseHandle(process); + module = GetModuleHandleA( "ntdll.dll" ); status = pNtQueryVirtualMemory(NtCurrentProcess(), pNtQueryVirtualMemory, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status);