summaryrefslogtreecommitdiff
path: root/network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp')
-rw-r--r--network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp b/network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp
index f2782ce7..e70d9999 100644
--- a/network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp
+++ b/network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp
@@ -113,20 +113,20 @@ NTSTATUS PrvKrnlHlprCopyBufferToMDL(_In_reads_(bytesToCopy) const BYTE* pBuffer,
SIZE_T mdlByteCount = 0;
SIZE_T remainingBytesToCopy = bytesToCopy;
SIZE_T copySize = 0;
+ UINT32 noExecute = 0;
*pBytesCopied = 0;
- if(MmGetMdlByteCount(pMDL) >= mdlOffset + bytesToCopy)
- {
- BYTE* pSystemAddress = 0;
- UINT32 noExecute = 0;
-
#if(NTDDI_VERSION >= NTDDI_WIN8)
- noExecute = MdlMappingNoExecute;
+ noExecute = MdlMappingNoExecute;
#endif /// (NTDDI_VERSION >= NTDDI_WIN8)
+ if(MmGetMdlByteCount(pMDL) >= mdlOffset + bytesToCopy)
+ {
+ BYTE* pSystemAddress = 0;
+
pSystemAddress = (BYTE*)MmGetSystemAddressForMdlSafe(pMDL,
LowPagePriority | noExecute);
if(pSystemAddress)
@@ -171,7 +171,7 @@ NTSTATUS PrvKrnlHlprCopyBufferToMDL(_In_reads_(bytesToCopy) const BYTE* pBuffer,
mdlByteCount);
pSystemAddress = (BYTE*)MmGetSystemAddressForMdlSafe(pMDL,
- LowPagePriority);
+ LowPagePriority | noExecute);
if(pSystemAddress)
{
RtlCopyMemory(pSystemAddress + mdlOffset,