Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3003)

Unified Diff: chrome/installer/setup/install_worker.cc

Issue 6610029: Create a "GetWOW64Status()" utility function and make the rest of the codebas... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/install_worker.cc
===================================================================
--- chrome/installer/setup/install_worker.cc (revision 76817)
+++ chrome/installer/setup/install_worker.cc (working copy)
@@ -19,6 +19,7 @@
#include "base/utf_string_conversions.h"
#include "base/version.h"
#include "base/win/registry.h"
+#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/setup_constants.h"
@@ -39,24 +40,6 @@
using base::win::RegKey;
-namespace {
-
-// This method tells if we are running on 64 bit platform so that we can copy
-// one extra exe. If the API call to determine 64 bit fails, we play it safe
-// and return true anyway so that the executable can be copied.
-bool Is64bit() {
- typedef BOOL (WINAPI* WOW_FUNC)(HANDLE, BOOL*);
- BOOL is_64 = FALSE;
-
- HMODULE module = GetModuleHandle(L"kernel32.dll");
- WOW_FUNC is_wow64 = reinterpret_cast<WOW_FUNC>(
- GetProcAddress(module, "IsWow64Process"));
- return (is_wow64 != NULL) &&
- (!(is_wow64)(GetCurrentProcess(), &is_64) || (is_64 != FALSE));
-}
-
-} // namespace
-
namespace installer {
// Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of
@@ -556,7 +539,9 @@
temp_path.value(), WorkItem::NEW_NAME_IF_IN_USE, new_chrome_exe.value());
// Extra executable for 64 bit systems.
- if (Is64bit()) {
+ // NOTE: We check for "not disabled" so that if the API call fails, we play it
+ // safe and copy the executable anyway.
+ if (base::win::GetWOW64Status() != base::win::WOW64_DISABLED) {
install_list->AddMoveTreeWorkItem(
src_path.Append(installer::kWowHelperExe).value(),
target_path.Append(installer::kWowHelperExe).value(),

Powered by Google App Engine
This is Rietveld 408576698