diff --git a/src/common/platform/memory.hpp b/src/common/platform/memory.hpp index 13779235..bf213b91 100644 --- a/src/common/platform/memory.hpp +++ b/src/common/platform/memory.hpp @@ -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) diff --git a/src/windows-emulator/syscalls/memory.cpp b/src/windows-emulator/syscalls/memory.cpp index e7977f49..0fa59202 100644 --- a/src/windows-emulator/syscalls/memory.cpp +++ b/src/windows-emulator/syscalls/memory.cpp @@ -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(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(region_info.allocation_length); image_info.Reserved = 0x10; });