From 4830bd4021c1ced51e1dfe7203bede510b6428b0 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 19 Feb 2019 13:41:26 +0000 Subject: [PATCH] Check for an SDK version before enabling VirtualAlloc2. This is mainly to keep the CI system happy: it's using an old SDK because the new version of cl.exe doesn't work with cmake... --- src/pal/pal_windows.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pal/pal_windows.h b/src/pal/pal_windows.h index 1a62908..ca81635 100644 --- a/src/pal/pal_windows.h +++ b/src/pal/pal_windows.h @@ -73,7 +73,8 @@ namespace snmalloc if (committed) flags |= MEM_COMMIT; -# if (WINVER >= _WIN32_WINNT_WIN10) && !defined(USE_SYSTEMATIC_TESTING) +# if (NTDDI_VERSION >= NTDDI_WIN10_RS5) && (WINVER >= _WIN32_WINNT_WIN10) && \ + !defined(USE_SYSTEMATIC_TESTING) // If we're on Windows 10 or newer, we can use the VirtualAlloc2 // function. The FromApp variant is useable by UWP applications and // cannot allocate executable memory.