From 9c0fa65110a1a4823d83cb0ea9865d4874539e19 Mon Sep 17 00:00:00 2001 From: Justin Stoecker Date: Thu, 28 Jul 2022 16:47:36 -0700 Subject: [PATCH] Scope CreateFileMapping2 to valid API partitions (#12374) --- onnxruntime/core/platform/windows/env.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/platform/windows/env.cc b/onnxruntime/core/platform/windows/env.cc index c18075cc7b..3f4a27bf43 100644 --- a/onnxruntime/core/platform/windows/env.cc +++ b/onnxruntime/core/platform/windows/env.cc @@ -369,7 +369,7 @@ class WindowsEnv : public Env { " - ", std::system_category().message(error_code)); } -#if NTDDI_VERSION >= NTDDI_WIN10_RS5 +#if NTDDI_VERSION >= NTDDI_WIN10_RS5 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) wil::unique_hfile file_mapping_handle{ CreateFileMapping2(file_handle.get(), nullptr,