| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <tchar.h> | 6 #include <tchar.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug_on_start.h" | 11 #include "base/debug_on_start.h" |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/win_util.h" | 13 #include "base/win_util.h" |
| 14 #include "chrome/app/breakpad.h" | 14 #include "chrome/app/breakpad.h" |
| 15 #include "chrome/app/client_util.h" | 15 #include "chrome/app/client_util.h" |
| 16 #include "chrome/app/google_update_client.h" | 16 #include "chrome/app/google_update_client.h" |
| 17 #include "chrome/app/result_codes.h" | 17 #include "chrome/app/result_codes.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "sandbox/src/sandbox_factory.h" | 19 #include "sandbox/src/sandbox_factory.h" |
| 20 #include "sandbox/src/dep.h" | 20 #include "sandbox/src/dep.h" |
| 21 | 21 |
| 22 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance, | 22 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance, |
| 23 wchar_t* command_line, int) { | 23 wchar_t* command_line, int) { |
| 24 base::EnableTerminationOnHeapCorruption(); | 24 base::EnableTerminationOnHeapCorruption(); |
| 25 | 25 |
| 26 // The exit manager is in charge of calling the dtors of singletons. | 26 // The exit manager is in charge of calling the dtors of singletons. |
| 27 base::AtExitManager exit_manager; | 27 base::AtExitManager exit_manager; |
| 28 | 28 |
| 29 win_util::WinVersion win_version = win_util::GetWinVersion(); | 29 win_util::WinVersion win_version = win_util::GetWinVersion(); |
| 30 if (win_version == win_util::WINVERSION_XP || | 30 if (win_version < win_util::WINVERSION_VISTA) { |
| 31 win_version == win_util::WINVERSION_SERVER_2003) { | |
| 32 // On Vista, this is unnecessary since it is controlled through the | 31 // On Vista, this is unnecessary since it is controlled through the |
| 33 // /NXCOMPAT linker flag. | 32 // /NXCOMPAT linker flag. |
| 34 // Enforces strong DEP support. | 33 // Enforces strong DEP support. |
| 35 sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED); | 34 sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED); |
| 36 } | 35 } |
| 37 | 36 |
| 38 // Get the interface pointer to the BrokerServices or TargetServices, | 37 // Get the interface pointer to the BrokerServices or TargetServices, |
| 39 // depending who we are. | 38 // depending who we are. |
| 40 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 39 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| 41 sandbox_info.broker_services = sandbox::SandboxFactory::GetBrokerServices(); | 40 sandbox_info.broker_services = sandbox::SandboxFactory::GetBrokerServices(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>( | 99 client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>( |
| 101 ::GetProcAddress(dll_handle, "ChromeMain")); | 100 ::GetProcAddress(dll_handle, "ChromeMain")); |
| 102 if (NULL != entry) | 101 if (NULL != entry) |
| 103 return (entry)(instance, &sandbox_info, command_line); | 102 return (entry)(instance, &sandbox_info, command_line); |
| 104 } | 103 } |
| 105 #endif | 104 #endif |
| 106 | 105 |
| 107 return ResultCodes::GOOGLE_UPDATE_LAUNCH_FAILED; | 106 return ResultCodes::GOOGLE_UPDATE_LAUNCH_FAILED; |
| 108 } | 107 } |
| 109 | 108 |
| OLD | NEW |