From 96eb96dfb613e4c745db6bd1f53a92fe7e2290fc Mon Sep 17 00:00:00 2001 From: karlf Date: Thu, 11 Aug 2016 13:28:13 -0700 Subject: Updated for "Windows 10 Anniversary Update" (Version 1607) --- .../trans/WFPSampler/syslib/HelperFunctions_Headers.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'network/trans/WFPSampler/syslib/HelperFunctions_Headers.cpp') 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, -- cgit v1.3.1