From bb48f1caace80a574a737b00f5c98b6c542d5831 Mon Sep 17 00:00:00 2001 From: Ben Ridley Date: Thu, 20 May 2021 16:30:52 -0700 Subject: [PATCH] Correct layout of SystemInfo structs to prevent incorrect fields being read Signed-off-by: Ben Ridley --- headers/sysinfoapi/sysinfoapi.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/sysinfoapi/sysinfoapi.go b/headers/sysinfoapi/sysinfoapi.go index 41471bb9..ebc6087b 100644 --- a/headers/sysinfoapi/sysinfoapi.go +++ b/headers/sysinfoapi/sysinfoapi.go @@ -36,8 +36,8 @@ type MemoryStatus struct { // wProcessorArchitecture is a wrapper for the union found in LP_SYSTEM_INFO // https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info type wProcessorArchitecture struct { - WReserved uint16 WProcessorArchitecture uint16 + WReserved uint16 } // ProcessorArchitecture is an idiomatic wrapper for wProcessorArchitecture @@ -60,7 +60,7 @@ type lpSystemInfo struct { DwPageSize uint32 LpMinimumApplicationAddress uintptr LpMaximumApplicationAddress uintptr - DwActiveProcessorMask uint32 + DwActiveProcessorMask uint DwNumberOfProcessors uint32 DwProcessorType uint32 DwAllocationGranularity uint32 @@ -74,7 +74,7 @@ type SystemInfo struct { PageSize uint32 MinimumApplicationAddress uintptr MaximumApplicationAddress uintptr - ActiveProcessorMask uint32 + ActiveProcessorMask uint NumberOfProcessors uint32 ProcessorType uint32 AllocationGranularity uint32