[Kernel/Memory] NtQueryVirtualMemory - Added support for returning X_MEM_FREE state

This commit is contained in:
Gliniak 2020-08-27 13:40:17 +02:00 committed by Triang3l
parent b3e537a5bf
commit eac7e2cd1f
1 changed files with 3 additions and 1 deletions

View File

@ -283,12 +283,14 @@ dword_result_t NtQueryVirtualMemory(
memory_basic_information_ptr->allocation_protect =
ToXdkProtectFlags(alloc_info.allocation_protect);
memory_basic_information_ptr->region_size = alloc_info.region_size;
uint32_t x_state = 0;
uint32_t x_state = X_MEM_FREE;
if (alloc_info.state & kMemoryAllocationReserve) {
x_state |= X_MEM_RESERVE;
x_state &= ~X_MEM_FREE;
}
if (alloc_info.state & kMemoryAllocationCommit) {
x_state |= X_MEM_COMMIT;
x_state &= ~X_MEM_FREE;
}
memory_basic_information_ptr->state = x_state;
memory_basic_information_ptr->protect = ToXdkProtectFlags(alloc_info.protect);