Commit bbd73667 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

ntdll: Split logic for MemoryBasicInformation into a separate function.

parent 0a66eaea
......@@ -3011,40 +3011,16 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
return 1;
}
#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.@)
* ZwQueryVirtualMemory (NTDLL.@)
*/
NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
MEMORY_INFORMATION_CLASS info_class, PVOID buffer,
SIZE_T len, SIZE_T *res_len )
/* get basic information about a memory block */
static NTSTATUS get_basic_memory_info( HANDLE process, LPCVOID addr,
MEMORY_BASIC_INFORMATION *info,
SIZE_T len, SIZE_T *res_len )
{
struct file_view *view;
char *base, *alloc_base = 0, *alloc_end = working_set_limit;
struct wine_rb_entry *ptr;
MEMORY_BASIC_INFORMATION *info = buffer;
sigset_t sigset;
if (info_class != MemoryBasicInformation)
{
switch(info_class)
{
UNIMPLEMENTED_INFO_CLASS(MemoryWorkingSetList);
UNIMPLEMENTED_INFO_CLASS(MemorySectionName);
UNIMPLEMENTED_INFO_CLASS(MemoryBasicVlmInformation);
default:
FIXME("(%p,%p,info_class=%d,%p,%ld,%p) Unknown information class\n",
process, addr, info_class, buffer, len, res_len);
return STATUS_INVALID_INFO_CLASS;
}
}
if (len < sizeof(MEMORY_BASIC_INFORMATION))
return STATUS_INFO_LENGTH_MISMATCH;
......@@ -3159,6 +3135,39 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
}
#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.@)
* ZwQueryVirtualMemory (NTDLL.@)
*/
NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
MEMORY_INFORMATION_CLASS info_class,
PVOID buffer, SIZE_T len, SIZE_T *res_len )
{
TRACE("(%p, %p, info_class=%d, %p, %ld, %p)\n",
process, addr, info_class, buffer, len, res_len);
switch(info_class)
{
case MemoryBasicInformation:
return get_basic_memory_info( process, addr, buffer, len, res_len );
UNIMPLEMENTED_INFO_CLASS(MemoryWorkingSetList);
UNIMPLEMENTED_INFO_CLASS(MemorySectionName);
UNIMPLEMENTED_INFO_CLASS(MemoryBasicVlmInformation);
default:
FIXME("(%p,%p,info_class=%d,%p,%ld,%p) Unknown information class\n",
process, addr, info_class, buffer, len, res_len);
return STATUS_INVALID_INFO_CLASS;
}
}
/***********************************************************************
* NtLockVirtualMemory (NTDLL.@)
* ZwLockVirtualMemory (NTDLL.@)
......
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