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

Unified Diff: chrome/installer/util/set_reg_value_work_item.cc

Issue 282363003: Add WOW64 support to the installer registry work items (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: nits. fix call to DeleteRegistryKey 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
Index: chrome/installer/util/set_reg_value_work_item.cc
diff --git a/chrome/installer/util/set_reg_value_work_item.cc b/chrome/installer/util/set_reg_value_work_item.cc
index b805a5d0af995071c30be984c291ac6576f22a6d..596fe7c8895ecd81944ddf262f16f4386b63a92c 100644
--- a/chrome/installer/util/set_reg_value_work_item.cc
+++ b/chrome/installer/util/set_reg_value_work_item.cc
@@ -14,6 +14,7 @@ SetRegValueWorkItem::~SetRegValueWorkItem() {
SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
const std::wstring& key_path,
+ REGSAM wow64_access,
const std::wstring& value_name,
const std::wstring& value_data,
bool overwrite)
@@ -21,15 +22,20 @@ SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
key_path_(key_path),
value_name_(value_name),
overwrite_(overwrite),
+ wow64_access_(wow64_access),
status_(SET_VALUE),
type_(REG_SZ),
previous_type_(0) {
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
const uint8* data = reinterpret_cast<const uint8*>(value_data.c_str());
value_.assign(data, data + (value_data.length() + 1) * sizeof(wchar_t));
}
SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
const std::wstring& key_path,
+ REGSAM wow64_access,
const std::wstring& value_name,
DWORD value_data,
bool overwrite)
@@ -37,15 +43,20 @@ SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
key_path_(key_path),
value_name_(value_name),
overwrite_(overwrite),
+ wow64_access_(wow64_access),
status_(SET_VALUE),
type_(REG_DWORD),
previous_type_(0) {
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
const uint8* data = reinterpret_cast<const uint8*>(&value_data);
value_.assign(data, data + sizeof(value_data));
}
SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
const std::wstring& key_path,
+ REGSAM wow64_access,
const std::wstring& value_name,
int64 value_data,
bool overwrite)
@@ -53,9 +64,13 @@ SetRegValueWorkItem::SetRegValueWorkItem(HKEY predefined_root,
key_path_(key_path),
value_name_(value_name),
overwrite_(overwrite),
+ wow64_access_(wow64_access),
status_(SET_VALUE),
type_(REG_QWORD),
previous_type_(0) {
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
const uint8* data = reinterpret_cast<const uint8*>(&value_data);
value_.assign(data, data + sizeof(value_data));
}
@@ -71,8 +86,9 @@ bool SetRegValueWorkItem::Do() {
}
status_ = VALUE_UNCHANGED;
- result = key.Open(predefined_root_, key_path_.c_str(),
- KEY_READ | KEY_SET_VALUE);
+ result = key.Open(predefined_root_,
+ key_path_.c_str(),
+ KEY_READ | KEY_SET_VALUE | wow64_access_);
if (result != ERROR_SUCCESS) {
VLOG(1) << "can not open " << key_path_ << " error: " << result;
return ignore_failure_;
@@ -127,7 +143,8 @@ void SetRegValueWorkItem::Rollback() {
}
base::win::RegKey key;
- LONG result = key.Open(predefined_root_, key_path_.c_str(), KEY_SET_VALUE);
+ LONG result = key.Open(
+ predefined_root_, key_path_.c_str(), KEY_SET_VALUE | wow64_access_);
if (result != ERROR_SUCCESS) {
VLOG(1) << "rollback: can not open " << key_path_ << " error: " << result;
return;
« no previous file with comments | « chrome/installer/util/set_reg_value_work_item.h ('k') | chrome/installer/util/set_reg_value_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698