Skip to content

Commit d8a2992

Browse files
committed
windows: Call SetProcessDEPPolicy directly
1 parent 1bd9ffd commit d8a2992

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/init.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -891,16 +891,7 @@ bool AppInitBasicSetup()
891891
#endif
892892
#ifdef WIN32
893893
// Enable Data Execution Prevention (DEP)
894-
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
895-
// A failure is non-critical and needs no further attention!
896-
#ifndef PROCESS_DEP_ENABLE
897-
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
898-
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
899-
#define PROCESS_DEP_ENABLE 0x00000001
900-
#endif
901-
typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
902-
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
903-
if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);
894+
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
904895
#endif
905896

906897
if (!SetupNetworking())

0 commit comments

Comments
 (0)