diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 18:18:55 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 18:18:55 +0000 |
commit | 35ef51a9b6944dd9c3852f2c78f6be0548fe6e5e (patch) | |
tree | c818bb2e3b792e8836f2949583c7000e4c0039da /chrome/app/chrome_exe_main.cc | |
parent | 1fcffab820c3a870d0c1b2baa71184984c2c7cc2 (diff) | |
download | chromium_src-35ef51a9b6944dd9c3852f2c78f6be0548fe6e5e.zip chromium_src-35ef51a9b6944dd9c3852f2c78f6be0548fe6e5e.tar.gz chromium_src-35ef51a9b6944dd9c3852f2c78f6be0548fe6e5e.tar.bz2 |
Enforces strong DEP all the time. Use the /NXCOMPAT linker flag on chrome.exe so there's no need to call anything on Vista and later to activate it.
Review URL: http://codereview.chromium.org/9050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_exe_main.cc')
-rw-r--r-- | chrome/app/chrome_exe_main.cc | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/chrome/app/chrome_exe_main.cc b/chrome/app/chrome_exe_main.cc index cec04a9..9f21096 100644 --- a/chrome/app/chrome_exe_main.cc +++ b/chrome/app/chrome_exe_main.cc @@ -10,6 +10,7 @@ #include "base/command_line.h" #include "base/debug_on_start.h" #include "base/process_util.h" +#include "base/win_util.h" #include "chrome/app/breakpad.h" #include "chrome/app/client_util.h" #include "chrome/app/google_update_client.h" @@ -25,25 +26,12 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance, // The exit manager is in charge of calling the dtors of singletons. base::AtExitManager exit_manager; - // Note that std::wstring and CommandLine got linked anyway because of - // breakpad. - CommandLine parsed_command_line; - std::wstring process_type = - parsed_command_line.GetSwitchValue(switches::kProcessType); - - const wchar_t* dll_name = L"chrome.dll"; - if (process_type == switches::kPluginProcess) { - // Plugin process. - // For plugins, we enable ATL7 thunking support because we saw old activex - // built with VC2002 in the wild still being used. - sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED_ATL7_COMPAT); - } else if (process_type == switches::kRendererProcess) { - // Renderer process. - // For the processes we control, we enforce strong DEP support. - sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED); - } else { - // Browser process. - // For the processes we control, we enforce strong DEP support. + win_util::WinVersion win_version = win_util::GetWinVersion(); + if (win_version == win_util::WINVERSION_XP || + win_version == win_util::WINVERSION_SERVER_2003) { + // On Vista, this is unnecessary since it is controlled through the + // /NXCOMPAT linker flag. + // Enforces strong DEP support. sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED); } @@ -54,6 +42,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance, if (!sandbox_info.broker_services) sandbox_info.target_services = sandbox::SandboxFactory::GetTargetServices(); + const wchar_t* dll_name = L"chrome.dll"; #if defined(GOOGLE_CHROME_BUILD) google_update::GoogleUpdateClient client; |