From 1cb47080738daf9185411e7ae3e3db5ff0ac615c Mon Sep 17 00:00:00 2001 From: Peter Sabath <31621424+peter-sabath@users.noreply.github.com> Date: Thu, 8 Aug 2019 14:37:34 +0200 Subject: [PATCH] src,win: improve unmanaged handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Used scoped disabling of managed code handling to ensure no other files get affected. PR-URL: https://github.com/nodejs/node-gyp/pull/1852 Reviewed-By: João Reis --- src/win_delay_load_hook.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/win_delay_load_hook.cc b/src/win_delay_load_hook.cc index 567c4cc8d7..169f8029f1 100644 --- a/src/win_delay_load_hook.cc +++ b/src/win_delay_load_hook.cc @@ -7,10 +7,10 @@ * This allows compiled addons to work when the host executable is renamed. */ -#pragma unmanaged - #ifdef _MSC_VER +#pragma managed(push, off) + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -34,4 +34,6 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; +#pragma managed(pop) + #endif