diff options
author | teor <teor@torproject.org> | 2018-09-07 12:58:11 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2018-09-07 12:58:11 +1000 |
commit | 8ef4bb7f3ee5e61c1a48ce7247fbe6fad773a8d4 (patch) | |
tree | 13fe59bb4f9539b0eafd2a84f4cb8cfbc5d2a1ff | |
parent | ff1486385aed1172c18a8a593dec2684de891f60 (diff) | |
download | tor-8ef4bb7f3ee5e61c1a48ce7247fbe6fad773a8d4.tar.gz tor-8ef4bb7f3ee5e61c1a48ce7247fbe6fad773a8d4.zip |
Windows: Stop calling SetProcessDEPPolicy() on 64-bit Windows
It is not supported, and always fails. Some compilers warn about the
function pointer cast on 64-bit Windows.
Fixes bug 27461; bugfix on 0.2.2.23-alpha.
-rw-r--r-- | changes/bug27461 | 5 | ||||
-rw-r--r-- | src/or/main.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/changes/bug27461 b/changes/bug27461 new file mode 100644 index 0000000000..3571ee816a --- /dev/null +++ b/changes/bug27461 @@ -0,0 +1,5 @@ + o Minor bugfixes (compilation): + - Stop calling SetProcessDEPPolicy() on 64-bit Windows. It is not + supported, and always fails. Some compilers warn about the function + pointer cast on 64-bit Windows. + Fixes bug 27461; bugfix on 0.2.2.23-alpha. diff --git a/src/or/main.c b/src/or/main.c index fcd8dc9024..55bcb18c4b 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -3433,6 +3433,13 @@ tor_main(int argc, char *argv[]) #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. */ @@ -3446,6 +3453,7 @@ tor_main(int argc, char *argv[]) setdeppolicy(3); } } +#endif /* !defined(_WIN64) */ #endif configure_backtrace_handler(get_version()); |