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

Unified Diff: chrome/installer/util/create_reg_key_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: nit: style on braces 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/create_reg_key_work_item.cc
diff --git a/chrome/installer/util/create_reg_key_work_item.cc b/chrome/installer/util/create_reg_key_work_item.cc
index 69043daff20b6ab0b01e490dd61417cd0d33d0b1..0894a6dac0c98ba1640335e6df2cef226386ef6d 100644
--- a/chrome/installer/util/create_reg_key_work_item.cc
+++ b/chrome/installer/util/create_reg_key_work_item.cc
@@ -34,10 +34,15 @@ CreateRegKeyWorkItem::~CreateRegKeyWorkItem() {
}
CreateRegKeyWorkItem::CreateRegKeyWorkItem(HKEY predefined_root,
- const std::wstring& path)
+ const std::wstring& path,
+ REGSAM wow64_access)
: predefined_root_(predefined_root),
path_(path),
+ wow64_access_(wow64_access),
key_created_(false) {
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
}
bool CreateRegKeyWorkItem::Do() {
@@ -55,8 +60,10 @@ bool CreateRegKeyWorkItem::Do() {
DWORD disposition;
key_path.assign(key_list_[i - 1]);
- if (key.CreateWithDisposition(predefined_root_, key_path.c_str(),
- &disposition, KEY_READ) == ERROR_SUCCESS) {
+ if (key.CreateWithDisposition(predefined_root_,
+ key_path.c_str(),
+ &disposition,
+ KEY_READ | wow64_access_) == ERROR_SUCCESS) {
if (disposition == REG_OPENED_EXISTING_KEY) {
if (key_created_) {
// This should not happen. Someone created a subkey under the key
@@ -91,8 +98,8 @@ void CreateRegKeyWorkItem::Rollback() {
std::vector<std::wstring>::iterator itr;
for (itr = key_list_.begin(); itr != key_list_.end(); ++itr) {
key_path.assign(*itr);
- if (SHDeleteEmptyKey(predefined_root_, key_path.c_str()) ==
- ERROR_SUCCESS) {
+ RegKey key(predefined_root_, L"", KEY_WRITE & wow64_access_);
grt (UTC plus 2) 2014/05/23 01:28:51 facepalm!
Will Harris 2014/05/23 03:19:21 found by tests!
+ if (key.DeleteEmptyKey(key_path.c_str()) == ERROR_SUCCESS) {
VLOG(1) << "rollback: delete " << key_path;
} else {
VLOG(1) << "rollback: can not delete " << key_path;
« no previous file with comments | « chrome/installer/util/create_reg_key_work_item.h ('k') | chrome/installer/util/create_reg_key_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698