Skip to content

Commit

Permalink
windows: Call SetProcessDEPPolicy directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ken2812221 committed Jan 23, 2019
1 parent 1bd9ffd commit d8a2992
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,7 @@ bool AppInitBasicSetup()
#endif
#ifdef WIN32
// Enable Data Execution Prevention (DEP)
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
// A failure is non-critical and needs no further attention!
#ifndef PROCESS_DEP_ENABLE
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
#define PROCESS_DEP_ENABLE 0x00000001
#endif
typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
#endif

if (!SetupNetworking())
Expand Down

0 comments on commit d8a2992

Please sign in to comment.