aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-01-13 16:36:16 +0800
committerfanquake <fanquake@gmail.com>2020-01-13 16:36:16 +0800
commitf2645c26017591f819344d24dc0a88dc32dde6fd (patch)
treefea9f5efc47b850116e7698e70519e58d63168eb /src/init.cpp
parente258ce792a4849927a6db51786732d71cbbb65fc (diff)
windows: Enable heap terminate-on-corruption
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
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index dc0f2ce05c..8ad32f4bdb 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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())