mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-19 03:33:56 +00:00
Fix region info query
This commit is contained in:
committed by
Maurice Heumann
parent
5a93462b45
commit
52d4e7e281
@@ -126,8 +126,8 @@ typedef struct _MEMORY_REGION_INFORMATION
|
||||
|
||||
std::int64_t RegionSize;
|
||||
std::int64_t CommitSize;
|
||||
DWORD64 PartitionId; // 19H1
|
||||
DWORD64 NodePreference; // 20H1
|
||||
// DWORD64 PartitionId; // 19H1
|
||||
// DWORD64 NodePreference; // 20H1
|
||||
} MEMORY_REGION_INFORMATION64, *PMEMORY_REGION_INFORMATION64;
|
||||
|
||||
// NOLINTEND(modernize-use-using)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace syscalls
|
||||
return_length.write(sizeof(MEMORY_REGION_INFORMATION64));
|
||||
}
|
||||
|
||||
if (memory_information_length != sizeof(MEMORY_REGION_INFORMATION64))
|
||||
if (memory_information_length < sizeof(MEMORY_REGION_INFORMATION64))
|
||||
{
|
||||
return STATUS_BUFFER_OVERFLOW;
|
||||
}
|
||||
@@ -108,8 +108,8 @@ namespace syscalls
|
||||
memset(&image_info, 0, sizeof(image_info));
|
||||
|
||||
image_info.AllocationBase = reinterpret_cast<void*>(region_info.allocation_base);
|
||||
image_info.AllocationProtect = 0;
|
||||
image_info.PartitionId = 0;
|
||||
image_info.AllocationProtect = map_emulator_to_nt_protection(region_info.initial_permissions);
|
||||
// image_info.PartitionId = 0;
|
||||
image_info.RegionSize = static_cast<int64_t>(region_info.allocation_length);
|
||||
image_info.Reserved = 0x10;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user