From 4a8f068ba559ceb597fb8b417a08c8fc96088aa4 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 8 Sep 2024 17:14:31 +0200 Subject: Windows: Add support for x86 and x64 build for driver and binaries using Visual Studio 2019 We also enable Control Flow Guard and Spectre Mitigation --- src/Common/Lzma_vs2019.vcxproj | 22 ++++++++++++++++------ src/Common/Tcdefs.h | 6 ++++++ src/Common/Zip_vs2019.vcxproj | 21 +++++++++++++++------ 3 files changed, 37 insertions(+), 12 deletions(-) (limited to 'src/Common') diff --git a/src/Common/Lzma_vs2019.vcxproj b/src/Common/Lzma_vs2019.vcxproj index 81a57daa..9f640dc5 100644 --- a/src/Common/Lzma_vs2019.vcxproj +++ b/src/Common/Lzma_vs2019.vcxproj @@ -61,6 +61,7 @@ Win32Proj Lzma Lzma + 10.0 @@ -128,22 +129,28 @@ - $(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ @@ -197,6 +204,7 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreaded + Guard Windows @@ -215,6 +223,7 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreaded + Guard Windows @@ -233,6 +242,7 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreaded + Guard Windows diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h index 9c3f8be7..8e6750a4 100644 --- a/src/Common/Tcdefs.h +++ b/src/Common/Tcdefs.h @@ -108,6 +108,12 @@ typedef unsigned __int64 uint64; #define LL(x) x##ui64 #endif +#if _MSC_VER > 1900 +#define VC_CDECL __cdecl // this is needed because Windows driver on VS2019 uses stdcall for build +#else +#define VC_CDECL +#endif + #pragma warning( disable : 4201 ) // disable: 4201 nonstandard extension used : nameless struct/union #pragma warning( disable : 4324 ) // disable: 4324 structure was padded due to __declspec(align()) diff --git a/src/Common/Zip_vs2019.vcxproj b/src/Common/Zip_vs2019.vcxproj index 26ab3310..b68dcab8 100644 --- a/src/Common/Zip_vs2019.vcxproj +++ b/src/Common/Zip_vs2019.vcxproj @@ -252,22 +252,28 @@ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ - $(Configuration)\ + $(ProjectDir)$(Configuration)\ + $(ProjectDir)$(Configuration)\ - $(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ + $(ProjectDir)$(Platform)\$(Configuration)\ @@ -337,6 +343,7 @@ _CRT_NONSTDC_NO_WARNINGS;_LIB;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions) MultiThreaded zlib;libzip + Guard Windows @@ -360,6 +367,7 @@ _CRT_NONSTDC_NO_WARNINGS;_LIB;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions) MultiThreaded zlib;libzip + Guard Windows @@ -383,6 +391,7 @@ _CRT_NONSTDC_NO_WARNINGS;_LIB;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions) MultiThreaded zlib;libzip + Guard Windows -- cgit v1.2.3