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

Unified Diff: chrome/installer/util/registry_key_backup.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
« no previous file with comments | « chrome/installer/util/registry_key_backup.h ('k') | chrome/installer/util/registry_key_backup_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/registry_key_backup.cc
diff --git a/chrome/installer/util/registry_key_backup.cc b/chrome/installer/util/registry_key_backup.cc
index 9bd520adaa524a040dbfd2beeca217222e99b466..74142482964315345214e6cca1eee3c989718b38 100644
--- a/chrome/installer/util/registry_key_backup.cc
+++ b/chrome/installer/util/registry_key_backup.cc
@@ -271,14 +271,19 @@ RegistryKeyBackup::RegistryKeyBackup() {
RegistryKeyBackup::~RegistryKeyBackup() {
}
-bool RegistryKeyBackup::Initialize(HKEY root, const wchar_t* key_path) {
+bool RegistryKeyBackup::Initialize(HKEY root,
+ const wchar_t* key_path,
+ REGSAM wow64_access) {
DCHECK(key_path);
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
RegKey key;
scoped_ptr<KeyData> key_data;
// Does the key exist?
- LONG result = key.Open(root, key_path, kKeyReadNoNotify);
+ LONG result = key.Open(root, key_path, kKeyReadNoNotify | wow64_access);
if (result == ERROR_SUCCESS) {
key_data.reset(new KeyData());
if (!key_data->Initialize(key)) {
@@ -295,14 +300,19 @@ bool RegistryKeyBackup::Initialize(HKEY root, const wchar_t* key_path) {
return true;
}
-bool RegistryKeyBackup::WriteTo(HKEY root, const wchar_t* key_path) const {
+bool RegistryKeyBackup::WriteTo(HKEY root,
+ const wchar_t* key_path,
+ REGSAM wow64_access) const {
DCHECK(key_path);
+ DCHECK(wow64_access == 0 ||
+ wow64_access == KEY_WOW64_32KEY ||
+ wow64_access == KEY_WOW64_64KEY);
bool success = false;
if (key_data_.get() != NULL) {
RegKey dest_key;
- LONG result = dest_key.Create(root, key_path, KEY_WRITE);
+ LONG result = dest_key.Create(root, key_path, KEY_WRITE | wow64_access);
if (result != ERROR_SUCCESS) {
LOG(ERROR) << "Failed to create destination key at " << key_path
<< " to write backup, result: " << result;
« no previous file with comments | « chrome/installer/util/registry_key_backup.h ('k') | chrome/installer/util/registry_key_backup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698