Skip to content

Commit

Permalink
windows: Enable heap terminate-on-corruption
Browse files Browse the repository at this point in the history
This is default behavior from Windows 8 onwards, however we still support
Windows 7, so it should make sense to explicitly enable this.

More info:
https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation
  • Loading branch information
fanquake committed Jan 13, 2020
1 parent e258ce7 commit f2645c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/init.cpp
Expand Up @@ -879,6 +879,9 @@ bool AppInitBasicSetup()
#ifdef WIN32
// Enable Data Execution Prevention (DEP)
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);

// Enable heap terminate-on-corruption
HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
#endif

if (!SetupNetworking())
Expand Down

0 comments on commit f2645c2

Please sign in to comment.