aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-11-01 12:55:10 -0400
committerNick Mathewson <nickm@torproject.org>2018-11-05 09:22:02 -0500
commit178c1821b2115972ce3c3f194d1fcbd0d75ca364 (patch)
tree56da01098fd0df3ecf08bdc36165030d0287b991 /src/app
parent175153a3290b3987faacac9d5390e87e1ad4a457 (diff)
downloadtor-178c1821b2115972ce3c3f194d1fcbd0d75ca364.tar.gz
tor-178c1821b2115972ce3c3f194d1fcbd0d75ca364.zip
Make the windows process parameter initialization a subsystem
Also, move it from "main" into lib/process
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main/main.c29
-rw-r--r--src/app/main/subsystem_list.c2
2 files changed, 2 insertions, 29 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c
index e3d7610c82..1e4cd37feb 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -1388,35 +1388,6 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
{
int result = 0;
-#ifdef _WIN32
-#ifndef HeapEnableTerminationOnCorruption
-#define HeapEnableTerminationOnCorruption 1
-#endif
- /* On heap corruption, just give up; don't try to play along. */
- HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
-
- /* SetProcessDEPPolicy is only supported on 32-bit Windows.
- * (On 64-bit Windows it always fails, and some compilers don't like the
- * PSETDEP cast.)
- * 32-bit Windows defines _WIN32.
- * 64-bit Windows defines _WIN32 and _WIN64. */
-#ifndef _WIN64
- /* Call SetProcessDEPPolicy to permanently enable DEP.
- The function will not resolve on earlier versions of Windows,
- and failure is not dangerous. */
- HMODULE hMod = GetModuleHandleA("Kernel32.dll");
- if (hMod) {
- typedef BOOL (WINAPI *PSETDEP)(DWORD);
- PSETDEP setdeppolicy = (PSETDEP)GetProcAddress(hMod,
- "SetProcessDEPPolicy");
- if (setdeppolicy) {
- /* PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION */
- setdeppolicy(3);
- }
- }
-#endif /* !defined(_WIN64) */
-#endif /* defined(_WIN32) */
-
#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
event_set_mem_functions(tor_malloc_, tor_realloc_, tor_free_);
#endif
diff --git a/src/app/main/subsystem_list.c b/src/app/main/subsystem_list.c
index 244dbadbd9..0f7d5d2ccc 100644
--- a/src/app/main/subsystem_list.c
+++ b/src/app/main/subsystem_list.c
@@ -9,6 +9,7 @@
#include "lib/cc/torint.h"
#include "lib/err/torerr_sys.h"
+#include "lib/process/winprocess_sys.h"
#include <stddef.h>
@@ -16,6 +17,7 @@
* Global list of the subsystems in Tor, in the order of their initialization.
**/
const subsys_fns_t *tor_subsystems[] = {
+ &sys_winprocess,
&sys_torerr,
};