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

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

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review comments Created 6 years, 2 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/app_commands.cc
diff --git a/chrome/installer/util/app_commands.cc b/chrome/installer/util/app_commands.cc
index de7dcc266ebbb4a414f11c01b1c9f622bc1aaedd..cb6f617dfde580c3ad78924226fd0b2343479f1c 100644
--- a/chrome/installer/util/app_commands.cc
+++ b/chrome/installer/util/app_commands.cc
@@ -19,12 +19,18 @@ AppCommands::AppCommands() {
AppCommands::~AppCommands() {
}
-bool AppCommands::Initialize(const base::win::RegKey& key) {
+bool AppCommands::Initialize(const base::win::RegKey& key, REGSAM wow64access) {
if (!key.Valid()) {
LOG(DFATAL) << "Cannot initialize AppCommands from an invalid key.";
return false;
}
+ if (wow64access != 0 && wow64access != KEY_WOW64_32KEY &&
+ wow64access != KEY_WOW64_64KEY) {
+ LOG(DFATAL) << "Invalid wow64access supplied to AppCommands.";
+ return false;
+ }
+
using base::win::RegistryKeyIterator;
static const wchar_t kEmptyString[] = L"";
@@ -33,8 +39,10 @@ bool AppCommands::Initialize(const base::win::RegKey& key) {
RegKey cmd_key;
LONG result;
AppCommand command;
- for (RegistryKeyIterator key_iterator(key.Handle(), kEmptyString);
- key_iterator.Valid(); ++key_iterator) {
+ for (RegistryKeyIterator key_iterator(
+ key.Handle(), kEmptyString, wow64access);
+ key_iterator.Valid();
+ ++key_iterator) {
const wchar_t* name = key_iterator.Name();
result = cmd_key.Open(key.Handle(), name, KEY_QUERY_VALUE);
if (result != ERROR_SUCCESS) {

Powered by Google App Engine
This is Rietveld 408576698