summaryrefslogtreecommitdiffstats
path: root/base/win
diff options
context:
space:
mode:
Diffstat (limited to 'base/win')
-rw-r--r--base/win/win_util.cc11
-rw-r--r--base/win/win_util.h18
-rw-r--r--base/win/windows_version.h6
3 files changed, 30 insertions, 5 deletions
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index 76d8c5d..93c086a 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -100,6 +100,17 @@ bool UserAccountControlIsEnabled() {
return (uac_enabled != 0);
}
+WindowsArchitecture GetWindowsArchitecture() {
+ SYSTEM_INFO system_info;
+ GetNativeSystemInfo(&system_info);
+ switch (system_info.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_INTEL: return X86_ARCHITECTURE;
+ case PROCESSOR_ARCHITECTURE_AMD64: return X64_ARCHITECTURE;
+ case PROCESSOR_ARCHITECTURE_IA64: return IA64_ARCHITECTURE;
+ default: return OTHER_ARCHITECTURE;
+ }
+}
+
bool SetAppIdForPropertyStore(IPropertyStore* property_store,
const wchar_t* app_id) {
DCHECK(property_store);
diff --git a/base/win/win_util.h b/base/win/win_util.h
index f95e05c..3520622 100644
--- a/base/win/win_util.h
+++ b/base/win/win_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -55,9 +55,23 @@ bool IsAltPressed();
// NOTE: The EnableLUA registry flag, which is ignored on Windows XP
// machines, might still exist and be set to 0 (UAC disabled), in which case
// this function will return false. You should therefore check this flag only
-// if the OS is Vista.
+// if the OS is Vista or later.
bool UserAccountControlIsEnabled();
+enum WindowsArchitecture {
+ X86_ARCHITECTURE,
+ X64_ARCHITECTURE,
+ IA64_ARCHITECTURE,
+ OTHER_ARCHITECTURE,
+};
+
+// Returns the processor architecture this copy of Windows natively uses.
+// For example, given an x64-capable processor, we have three possibilities:
+// 32-bit Chrome running on 32-bit Windows: X86_ARCHITECTURE
+// 32-bit Chrome running on 64-bit Windows via WOW64: X64_ARCHITECTURE
+// 64-bit Chrome running on 64-bit Windows: X64_ARCHITECTURE
+WindowsArchitecture GetWindowsArchitecture();
+
// Sets the application id in given IPropertyStore. The function is intended
// for tagging application/chromium shortcut, browser window and jump list for
// Win7.
diff --git a/base/win/windows_version.h b/base/win/windows_version.h
index 0cfb2c7..bdd783d 100644
--- a/base/win/windows_version.h
+++ b/base/win/windows_version.h
@@ -15,10 +15,10 @@ namespace win {
// "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values,
// though.
enum Version {
- VERSION_PRE_2000 = 0, // Not supported
- VERSION_2000 = 1, // Not supported
+ VERSION_PRE_2000 = 0, // Not supported
+ VERSION_2000 = 1, // Not supported
VERSION_XP = 2,
- VERSION_SERVER_2003 = 3,
+ VERSION_SERVER_2003 = 3, // Also includes Windows XP Professional x64 edition
VERSION_VISTA = 4,
VERSION_2008 = 5,
VERSION_WIN7 = 6,