Commit c6373abc authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Update the MEMORY_INFORMATION_CLASS enumeration.

parent 669d1cce
......@@ -4028,7 +4028,7 @@ static void test_Wow64Transition(void)
}
status = NtQueryVirtualMemory(GetCurrentProcess(), *pWow64Transition,
MemorySectionName, name, sizeof(buffer), NULL);
MemoryMappedFilenameInformation, name, sizeof(buffer), NULL);
ok(!status, "got %#x\n", status);
filepart = name->SectionFileName.Buffer + name->SectionFileName.Length / sizeof(WCHAR);
while (*filepart != '\\') --filepart;
......
......@@ -1133,7 +1133,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetMappedFileNameW( HANDLE process, void *addr, W
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (!set_ntstatus( NtQueryVirtualMemory( process, addr, MemorySectionName, mem, sizeof(buffer), NULL )))
if (!set_ntstatus( NtQueryVirtualMemory( process, addr, MemoryMappedFilenameInformation,
mem, sizeof(buffer), NULL )))
return 0;
len = mem->SectionFileName.Length / sizeof(WCHAR);
......@@ -1504,7 +1505,8 @@ BOOL WINAPI /* DECLSPEC_HOTPATCH */ InitializeProcessForWsWatch( HANDLE process
BOOL WINAPI DECLSPEC_HOTPATCH QueryWorkingSet( HANDLE process, void *buffer, DWORD size )
{
TRACE( "(%p, %p, %d)\n", process, buffer, size );
return set_ntstatus( NtQueryVirtualMemory( process, NULL, MemoryWorkingSetList, buffer, size, NULL ));
return set_ntstatus( NtQueryVirtualMemory( process, NULL, MemoryWorkingSetInformation,
buffer, size, NULL ));
}
......
......@@ -2649,7 +2649,7 @@ static void test_queryvirtualmemory(void)
module = GetModuleHandleA( "ntdll.dll" );
memset(buffer, 0xcc, sizeof(buffer));
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemoryMappedFilenameInformation,
name, sizeof(*name) + 16, &readcount);
ok(status == STATUS_BUFFER_OVERFLOW, "got %08x\n", status);
ok(name->SectionFileName.Length == 0xcccc || broken(!name->SectionFileName.Length), /* vista64 */
......@@ -2658,7 +2658,7 @@ static void test_queryvirtualmemory(void)
memset(buffer, 0xcc, sizeof(buffer));
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemoryMappedFilenameInformation,
name, sizeof(buffer), &readcount);
ok(status == STATUS_SUCCESS, "got %08x\n", status);
ok(name->SectionFileName.Buffer == (WCHAR *)(name + 1), "Wrong ptr %p/%p\n",
......@@ -2672,18 +2672,18 @@ static void test_queryvirtualmemory(void)
"buffer not null-terminated\n" );
memset(buffer, 0xcc, sizeof(buffer));
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemoryMappedFilenameInformation,
name, sizeof(buffer), NULL);
ok(status == STATUS_SUCCESS, "got %08x\n", status);
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemoryMappedFilenameInformation,
NULL, sizeof(buffer), NULL);
ok(status == STATUS_ACCESS_VIOLATION, "got %08x\n", status);
memset(buffer, 0xcc, sizeof(buffer));
prev = readcount;
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 321, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 321, MemoryMappedFilenameInformation,
name, sizeof(*name) - 1, &readcount);
ok(status == STATUS_INFO_LENGTH_MISMATCH, "got %08x\n", status);
ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length);
......@@ -2691,7 +2691,7 @@ static void test_queryvirtualmemory(void)
memset(buffer, 0xcc, sizeof(buffer));
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory((HANDLE)0xdead, (char *)module + 1234, MemorySectionName,
status = pNtQueryVirtualMemory((HANDLE)0xdead, (char *)module + 1234, MemoryMappedFilenameInformation,
name, sizeof(buffer), &readcount);
ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
ok(readcount == 0xdeadbeef || broken(readcount == 1024 + sizeof(*name)), /* wow64 */
......@@ -2699,7 +2699,7 @@ static void test_queryvirtualmemory(void)
memset(buffer, 0xcc, sizeof(buffer));
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), buffer, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), buffer, MemoryMappedFilenameInformation,
name, sizeof(buffer), &readcount);
ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status);
ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length);
......@@ -2707,7 +2707,7 @@ static void test_queryvirtualmemory(void)
"Wrong count %lu\n", readcount);
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemoryMappedFilenameInformation,
name, sizeof(buffer), &readcount);
ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status);
ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length);
......@@ -2715,7 +2715,7 @@ static void test_queryvirtualmemory(void)
"Wrong count %lu\n", readcount);
readcount = 0xdeadbeef;
status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemorySectionName,
status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemoryMappedFilenameInformation,
name, sizeof(*name) - 1, &readcount);
ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status);
ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length);
......
......@@ -4258,10 +4258,6 @@ static NTSTATUS get_memory_section_name( HANDLE process, LPCVOID addr,
return status;
}
#define UNIMPLEMENTED_INFO_CLASS(c) \
case c: \
FIXME("(process=%p,addr=%p) Unimplemented information class: " #c "\n", process, addr); \
return STATUS_INVALID_INFO_CLASS
/***********************************************************************
* NtQueryVirtualMemory (NTDLL.@)
......@@ -4278,13 +4274,12 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
{
case MemoryBasicInformation:
return get_basic_memory_info( process, addr, buffer, len, res_len );
case MemoryWorkingSetExInformation:
return get_working_set_ex( process, addr, buffer, len, res_len );
case MemorySectionName:
return get_memory_section_name( process, addr, buffer, len, res_len );
UNIMPLEMENTED_INFO_CLASS(MemoryWorkingSetList);
UNIMPLEMENTED_INFO_CLASS(MemoryBasicVlmInformation);
case MemoryMappedFilenameInformation:
return get_memory_section_name( process, addr, buffer, len, res_len );
default:
FIXME("(%p,%p,info_class=%d,%p,%ld,%p) Unknown information class\n",
......
......@@ -370,7 +370,7 @@ static BOOL nt_get_mapped_file_name(HANDLE process, LPVOID addr, LPWSTR name, DW
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buf_len);
ret_len = 0xdeadbeef;
status = pNtQueryVirtualMemory(process, addr, MemorySectionName, buf, buf_len, &ret_len);
status = pNtQueryVirtualMemory(process, addr, MemoryMappedFilenameInformation, buf, buf_len, &ret_len);
ok(!status, "NtQueryVirtualMemory error %x\n", status);
section_name = (MEMORY_SECTION_NAME *)buf;
......
......@@ -328,7 +328,7 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args )
res_len = sizeof(MEMORY_BASIC_INFORMATION32);
break;
case MemorySectionName: /* MEMORY_SECTION_NAME */
case MemoryMappedFilenameInformation: /* MEMORY_SECTION_NAME */
{
MEMORY_SECTION_NAME *info;
MEMORY_SECTION_NAME32 *info32 = ptr;
......
......@@ -1907,10 +1907,17 @@ typedef enum _WINSTATIONINFOCLASS {
typedef enum _MEMORY_INFORMATION_CLASS {
MemoryBasicInformation,
MemoryWorkingSetList,
MemorySectionName,
MemoryBasicVlmInformation,
MemoryWorkingSetExInformation
MemoryWorkingSetInformation,
MemoryMappedFilenameInformation,
MemoryRegionInformation,
MemoryWorkingSetExInformation,
MemorySharedCommitInformation,
MemoryImageInformation,
MemoryRegionInformationEx,
MemoryPrivilegedBasicInformation,
MemoryEnclaveImageInformation,
MemoryBasicInformationCapped,
MemoryPhysicalContiguityInformation,
} MEMORY_INFORMATION_CLASS;
typedef struct _MEMORY_SECTION_NAME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment