diff --git a/src/Domito.CodeIntegrity.cpp b/src/Domito.CodeIntegrity.cpp
index a03ac59..de67e90 100644
--- a/src/Domito.CodeIntegrity.cpp
+++ b/src/Domito.CodeIntegrity.cpp
@@ -134,7 +134,7 @@ DomitoCalculatePortableExecutableDigest(
ULONG copySize = phDos->e_lfanew + sizeof(IMAGE_FILE_HEADER) + 4 + 0x40;
#pragma warning(disable:4996)
const PUCHAR pBuf = (PUCHAR)ExAllocatePoolWithTag(
- NonPagedPool,
+ NonPagedPoolNx,
16 * 512 * 512,
DOMITO_POOL_TAG
);
@@ -195,7 +195,7 @@ DomitoCalculatePortableExecutableDigest(
// Allocate a buffer to store the resulting hash
//
#pragma warning(disable:4996)
- pHash = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, hashLength, DOMITO_POOL_TAG);
+ pHash = (PUCHAR)ExAllocatePoolWithTag(NonPagedPoolNx, hashLength, DOMITO_POOL_TAG);
#pragma warning(default:4996)
if (!pHash)
{
diff --git a/src/Domito.vcxproj b/src/Domito.vcxproj
index c11c11c..760de2e 100644
--- a/src/Domito.vcxproj
+++ b/src/Domito.vcxproj
@@ -90,6 +90,7 @@
$(SolutionDir)include;$(IntDir);%(AdditionalIncludeDirectories)
/kernel %(AdditionalOptions)
+ POOL_NX_OPTIN=1;_WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions)
@@ -99,18 +100,21 @@
$(SolutionDir)include;$(IntDir);%(AdditionalIncludeDirectories)
/kernel %(AdditionalOptions)
+ POOL_NX_OPTIN=1;_WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions)
$(SolutionDir)include;$(IntDir);%(AdditionalIncludeDirectories)
/kernel %(AdditionalOptions)
+ POOL_NX_OPTIN=1;_ARM64_;ARM64;_USE_DECLSPECS_FOR_SAL=1;STD_CALL;%(PreprocessorDefinitions)
$(SolutionDir)include;$(IntDir);%(AdditionalIncludeDirectories)
/kernel %(AdditionalOptions)
+ POOL_NX_OPTIN=1;_ARM64_;ARM64;_USE_DECLSPECS_FOR_SAL=1;STD_CALL;%(PreprocessorDefinitions)