Module: wine Branch: master Commit: 7ae1b2897e3fe8fa10dff50d2e96d40040223bf4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ae1b2897e3fe8fa10dff50d2e...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Dec 7 20:52:16 2006 +0100
ntdll: Check the NX compatibility flag for every loaded module.
---
dlls/ntdll/loader.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 4d15779..23c6e3b 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -681,6 +681,12 @@ static WINE_MODREF *alloc_module( HMODUL /* wait until init is called for inserting into this list */ wm->ldr.InInitializationOrderModuleList.Flink = NULL; wm->ldr.InInitializationOrderModuleList.Blink = NULL; + + if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) + { + WARN( "disabling no-exec because of %s\n", debugstr_w(wm->ldr.BaseDllName.Buffer) ); + VIRTUAL_SetForceExec( TRUE ); + } return wm; }
@@ -2126,8 +2132,6 @@ void WINAPI LdrInitializeThunk( ULONG un
peb->ProcessParameters->ImagePathName = wm->ldr.FullDllName; version_init( wm->ldr.FullDllName.Buffer ); - if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) - VIRTUAL_SetForceExec( TRUE );
/* the main exe needs to be the first in the load order list */ RemoveEntryList( &wm->ldr.InLoadOrderModuleList );