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

Unified Diff: base/win/registry.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: Created 6 years, 3 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: base/win/registry.cc
diff --git a/base/win/registry.cc b/base/win/registry.cc
index a6cb9ae89f789a78461e7d611374e603f492b724..51a1466f22818ff2cf491ce2e1c9b6451f69131e 100644
--- a/base/win/registry.cc
+++ b/base/win/registry.cc
@@ -487,10 +487,13 @@ LONG RegKey::RegDelRecurse(HKEY root_key,
// RegistryValueIterator ------------------------------------------------------
RegistryValueIterator::RegistryValueIterator(HKEY root_key,
- const wchar_t* folder_key)
+ const wchar_t* folder_key,
+ REGSAM wow64access)
: name_(MAX_PATH, L'\0'),
value_(MAX_PATH, L'\0') {
- LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
+ DCHECK(!wow64access || wow64access & kWow64AccessMask);
+ LONG result =
+ RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_);
if (result != ERROR_SUCCESS) {
key_ = NULL;
} else {
@@ -576,8 +579,11 @@ bool RegistryValueIterator::Read() {
// RegistryKeyIterator --------------------------------------------------------
RegistryKeyIterator::RegistryKeyIterator(HKEY root_key,
- const wchar_t* folder_key) {
- LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
+ const wchar_t* folder_key,
+ REGSAM wow64access) {
+ DCHECK(!wow64access || wow64access & kWow64AccessMask);
+ LONG result =
+ RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_);
if (result != ERROR_SUCCESS) {
key_ = NULL;
} else {

Powered by Google App Engine
This is Rietveld 408576698