From 4fb1e212c1ca110f8dd47560b2f3afbec8842bb1 Mon Sep 17 00:00:00 2001 From: Benjamin Oldenburg Date: Fri, 20 Mar 2026 16:38:47 +0700 Subject: [PATCH] winnt.h: fix ARM64 CONTEXT V register type The fallback CONTEXT struct for ARM64 (used when __aarch64__ is defined but _ARM64_CONTEXT_DECLARED is not set) incorrectly defined V[32] as DWORD64 (64-bit) instead of ARM64_NT_NEON128 (128-bit). This caused register corruption when RtlRestoreContext restores NEON/VFP registers, as the struct size was 256 bytes instead of the correct 512 bytes. Fixes potential corruption on toolchains that define __aarch64__ but not _ARM64_ (e.g., clang on macOS or certain cross-compilation scenarios). --- win32/include/winapi/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/include/winapi/winnt.h b/win32/include/winapi/winnt.h index 0897e2af..37d55483 100644 --- a/win32/include/winapi/winnt.h +++ b/win32/include/winapi/winnt.h @@ -2079,7 +2079,7 @@ typedef DWORD LCID; DWORD64 Lr; DWORD64 Sp; DWORD64 Pc; - DWORD64 V[32]; + ARM64_NT_NEON128 V[32]; DWORD Fpcr; DWORD Fpsr; DWORD Bcr[8];