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

Unified Diff: chrome/installer/gcapi/gcapi.cc

Issue 300593002: Make omaha, gcapi and uninstall registry accesses use Wow6432Node on 64-bit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/installer/gcapi/gcapi_last_run_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/gcapi/gcapi.cc
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 17974981c04176aef6b17fdb603bd7859dda3a57..3d73af0ba6ef66234ab8c57217b0d430982fcd2c 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -203,7 +203,9 @@ bool CanReOfferChrome(BOOL set_flag) {
bool IsChromeInstalled(HKEY root_key) {
RegKey key;
- return key.Open(root_key, kChromeRegClientsKey, KEY_READ) == ERROR_SUCCESS &&
+ return key.Open(root_key,
+ kChromeRegClientsKey,
+ KEY_READ | KEY_WOW64_32KEY) == ERROR_SUCCESS &&
key.HasValue(kChromeRegVersion);
}
@@ -211,7 +213,7 @@ bool IsChromeInstalled(HKEY root_key) {
bool RegKeyHasC1F(HKEY root, const wchar_t* subkey) {
RegKey key;
DWORD value;
- return key.Open(root, subkey, KEY_READ) == ERROR_SUCCESS &&
+ return key.Open(root, subkey, KEY_READ | KEY_WOW64_32KEY) == ERROR_SUCCESS &&
key.ReadValueDW(kC1FKey, &value) == ERROR_SUCCESS &&
value == static_cast<DWORD>(1);
}
@@ -276,7 +278,8 @@ bool VerifyHKLMAccess() {
HKEY key = NULL;
if (::RegCreateKeyEx(HKEY_LOCAL_MACHINE, kGCAPITempKey, 0, NULL,
- REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_READ | KEY_WRITE | KEY_WOW64_32KEY, NULL,
&key, &disposition) == ERROR_SUCCESS) {
if (::RegSetValueEx(key, str, 0, REG_SZ, (LPBYTE)str,
(DWORD)lstrlen(str)) == ERROR_SUCCESS) {
@@ -595,8 +598,9 @@ int __stdcall GoogleChromeDaysSinceLastRun() {
if (IsChromeInstalled(HKEY_LOCAL_MACHINE) ||
IsChromeInstalled(HKEY_CURRENT_USER)) {
- RegKey client_state(
- HKEY_CURRENT_USER, kChromeRegClientStateKey, KEY_QUERY_VALUE);
+ RegKey client_state(HKEY_CURRENT_USER,
+ kChromeRegClientStateKey,
+ KEY_QUERY_VALUE | KEY_WOW64_32KEY);
if (client_state.Valid()) {
std::wstring last_run;
int64 last_run_value = 0;
@@ -748,8 +752,9 @@ BOOL __stdcall CanOfferRelaunch(const wchar_t** partner_brandcode_list,
// relaunch offer for the current user;
RegKey key;
DWORD min_relaunch_date;
- if (key.Open(HKEY_CURRENT_USER, kChromeRegClientStateKey,
- KEY_QUERY_VALUE) == ERROR_SUCCESS &&
+ if (key.Open(HKEY_CURRENT_USER,
+ kChromeRegClientStateKey,
+ KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS &&
key.ReadValueDW(kRelaunchAllowedAfterValue,
&min_relaunch_date) == ERROR_SUCCESS &&
FormatDateOffsetByMonths(0) < min_relaunch_date) {
@@ -773,8 +778,9 @@ BOOL __stdcall SetRelaunchOffered(const wchar_t** partner_brandcode_list,
// Store the relaunched brand code and the minimum date for relaunch (6 months
// from now), and set the Omaha experiment label.
RegKey key;
- if (key.Create(HKEY_CURRENT_USER, kChromeRegClientStateKey,
- KEY_SET_VALUE) != ERROR_SUCCESS ||
+ if (key.Create(HKEY_CURRENT_USER,
+ kChromeRegClientStateKey,
+ KEY_SET_VALUE | KEY_WOW64_32KEY) != ERROR_SUCCESS ||
key.WriteValue(kRelaunchBrandcodeValue,
relaunch_brandcode) != ERROR_SUCCESS ||
key.WriteValue(kRelaunchAllowedAfterValue,
« no previous file with comments | « no previous file | chrome/installer/gcapi/gcapi_last_run_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698