diff --git a/src/common/platform/kernel_mapped.hpp b/src/common/platform/kernel_mapped.hpp index c173f574..931c5d35 100644 --- a/src/common/platform/kernel_mapped.hpp +++ b/src/common/platform/kernel_mapped.hpp @@ -51,8 +51,8 @@ union PEB_BITFIELD_UNION typedef struct _LIST_ENTRY64 { - struct _LIST_ENTRY* Flink; - struct _LIST_ENTRY* Blink; + ULONGLONG Flink; + ULONGLONG Blink; } LIST_ENTRY64, *PLIST_ENTRY64, *RESTRICTED_POINTER PRLIST_ENTRY64; #endif @@ -187,9 +187,9 @@ typedef struct _API_SET_NAMESPACE union PEB_CONTEXT_DATA_UNION64 { - void* pContextData; // WIN7 - void* pUnused; // WIN10 - void* EcCodeBitMap; // WIN11 + std::uint64_t pContextData; // WIN7 + std::uint64_t pUnused; // WIN10 + std::uint64_t EcCodeBitMap; // WIN11 }; union PEB_TRACING_FLAGS_UNION @@ -228,18 +228,18 @@ typedef struct _CPTABLEINFO USHORT TransUniDefaultChar; USHORT DBCSCodePage; UCHAR LeadByte[MAXIMUM_LEADBYTES]; - USHORT* MultiByteTable; - void* WideCharTable; - USHORT* DBCSRanges; - USHORT* DBCSOffsets; + EMULATOR_CAST(uint64_t, USHORT*) MultiByteTable; + EMULATOR_CAST(uint64_t, void*) WideCharTable; + EMULATOR_CAST(uint64_t, USHORT*) DBCSRanges; + EMULATOR_CAST(uint64_t, USHORT*) DBCSOffsets; } CPTABLEINFO, *PCPTABLEINFO; typedef struct _NLSTABLEINFO { CPTABLEINFO OemTableInfo; CPTABLEINFO AnsiTableInfo; - USHORT* UpperCaseTable; - USHORT* LowerCaseTable; + EMULATOR_CAST(uint64_t, USHORT*) UpperCaseTable; + EMULATOR_CAST(uint64_t, USHORT*) LowerCaseTable; } NLSTABLEINFO, *PNLSTABLEINFO; typedef struct _PEB64 diff --git a/src/common/platform/memory.hpp b/src/common/platform/memory.hpp index 44e37103..8f6023cd 100644 --- a/src/common/platform/memory.hpp +++ b/src/common/platform/memory.hpp @@ -78,7 +78,7 @@ typedef struct DECLSPEC_ALIGN(16) _EMU_MEMORY_BASIC_INFORMATION64 typedef struct _MEMORY_IMAGE_INFORMATION64 { - void* ImageBase; + uint64_t ImageBase; std::int64_t SizeOfImage; union @@ -98,7 +98,7 @@ typedef struct _MEMORY_IMAGE_INFORMATION64 typedef struct _MEMORY_REGION_INFORMATION { - void* AllocationBase; + uint64_t AllocationBase; ULONG AllocationProtect; union diff --git a/src/windows-emulator/syscalls/memory.cpp b/src/windows-emulator/syscalls/memory.cpp index 26d3cb98..768f6791 100644 --- a/src/windows-emulator/syscalls/memory.cpp +++ b/src/windows-emulator/syscalls/memory.cpp @@ -76,7 +76,7 @@ namespace syscalls const emulator_object info{c.emu, memory_information}; info.access([&](MEMORY_IMAGE_INFORMATION64& image_info) { - image_info.ImageBase = reinterpret_cast(mod->image_base); + image_info.ImageBase = mod->image_base; image_info.SizeOfImage = static_cast(mod->size_of_image); image_info.ImageFlags = 0; }); @@ -107,7 +107,7 @@ namespace syscalls info.access([&](MEMORY_REGION_INFORMATION64& image_info) { memset(&image_info, 0, sizeof(image_info)); - image_info.AllocationBase = reinterpret_cast(region_info.allocation_base); + image_info.AllocationBase = region_info.allocation_base; 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);