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

Unified Diff: chrome/browser/extensions/external_registry_loader_win.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/browser/extensions/external_registry_loader_win.cc
diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc
index ce44ae75dcf4603b35de9c73dda36d0784505509..ce61b272650599ce2bb8d40bcc5bef02b2edbf47 100644
--- a/chrome/browser/extensions/external_registry_loader_win.cc
+++ b/chrome/browser/extensions/external_registry_loader_win.cc
@@ -68,7 +68,9 @@ void ExternalRegistryLoader::LoadOnFileThread() {
// A map of IDs, to weed out duplicates between HKCU and HKLM.
std::set<base::string16> keys;
base::win::RegistryKeyIterator iterator_machine_key(
- HKEY_LOCAL_MACHINE, base::ASCIIToWide(kRegistryExtensions).c_str());
+ HKEY_LOCAL_MACHINE,
+ base::ASCIIToWide(kRegistryExtensions).c_str(),
+ KEY_WOW64_32KEY);
for (; iterator_machine_key.Valid(); ++iterator_machine_key)
keys.insert(iterator_machine_key.Name());
base::win::RegistryKeyIterator iterator_user_key(
@@ -86,13 +88,13 @@ void ExternalRegistryLoader::LoadOnFileThread() {
key_path.append(L"\\");
key_path.append(*it);
if (key.Open(HKEY_LOCAL_MACHINE,
- key_path.c_str(), KEY_READ) != ERROR_SUCCESS) {
- if (key.Open(HKEY_CURRENT_USER,
- key_path.c_str(), KEY_READ) != ERROR_SUCCESS) {
- LOG(ERROR) << "Unable to read registry key at path (HKLM & HKCU): "
- << key_path << ".";
- continue;
- }
+ key_path.c_str(),
+ KEY_READ | KEY_WOW64_32KEY) != ERROR_SUCCESS &&
+ key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ) !=
+ ERROR_SUCCESS) {
+ LOG(ERROR) << "Unable to read registry key at path (HKLM & HKCU): "
+ << key_path << ".";
+ continue;
}
std::string id = base::UTF16ToASCII(*it);

Powered by Google App Engine
This is Rietveld 408576698