Commit 89486ccb authored by Geoffroy Couprie's avatar Geoffroy Couprie Committed by Jean-Baptiste Kempf

Win32: Activate DEP on XP SP3. DEP is useless without ASLR, but people using...

Win32: Activate DEP on XP SP3. DEP is useless without ASLR, but people using an 10 year old OS don't have the right to complain
parent 167a3db3
...@@ -121,6 +121,20 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ...@@ -121,6 +121,20 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
int argc; int argc;
#ifndef UNDER_CE #ifndef UNDER_CE
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
HINSTANCE h_Kernel32 = LoadLibraryW(L"kernel32.dll");
if(h_Kernel32)
{
BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
# define PROCESS_DEP_ENABLE 1
mySetProcessDEPPolicy = (BOOL WINAPI (*)(DWORD))
GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
if(mySetProcessDEPPolicy)
mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
FreeLibrary(h_Kernel32);
}
wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc); wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
if (wargv == NULL) if (wargv == NULL)
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment