From: Derek Lesho Subject: [PATCH 3/3] Specify PAGE_EXECUTE_READWRITE when NonPagedPoolExecute is requested. Message-Id: <20180901054101.2032-3-dereklesho52@Gmail.com> Date: Sat, 1 Sep 2018 01:41:01 -0400 In-Reply-To: <20180901054101.2032-1-dereklesho52@Gmail.com> References: <20180901054101.2032-1-dereklesho52@Gmail.com> Make wine allocate executable memory when the driver requests it. BEDaisy.sys, battleye's driver uses this POOL_TYPE, resulting in a page fault on execute access if the memory is not executable. Signed-off-by: Derek Lesho --- dlls/ntoskrnl.exe/ntoskrnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 53cf37febe..f32ef58080 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -1933,7 +1933,7 @@ PVOID WINAPI ExAllocatePoolWithQuota( POOL_TYPE type, SIZE_T size ) PVOID WINAPI ExAllocatePoolWithTag( POOL_TYPE type, SIZE_T size, ULONG tag ) { /* FIXME: handle page alignment constraints */ - void *ret = VirtualAlloc( NULL, size, (MEM_RESERVE | MEM_COMMIT), PAGE_READWRITE ); + void *ret = VirtualAlloc( NULL, size, (MEM_RESERVE | MEM_COMMIT), (type==NonPagedPoolExecute) ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE ); TRACE( "%lu pool %u -> %p\n", size, type, ret ); return ret; } -- 2.18.0