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

Side by Side Diff: base/win/registry.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/win/pe_image.h ('k') | base/win/windows_version.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/win/registry.h" 5 #include "base/win/registry.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 void RegistryKeyIterator::Initialize(HKEY root_key, 655 void RegistryKeyIterator::Initialize(HKEY root_key,
656 const wchar_t* folder_key, 656 const wchar_t* folder_key,
657 REGSAM wow64access) { 657 REGSAM wow64access) {
658 DCHECK_EQ(wow64access & ~kWow64AccessMask, static_cast<REGSAM>(0)); 658 DCHECK_EQ(wow64access & ~kWow64AccessMask, static_cast<REGSAM>(0));
659 LONG result = 659 LONG result =
660 RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_); 660 RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_);
661 if (result != ERROR_SUCCESS) { 661 if (result != ERROR_SUCCESS) {
662 key_ = NULL; 662 key_ = NULL;
663 } else { 663 } else {
664 DWORD count = 0; 664 DWORD count = 0;
665 LONG result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL, 665 result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL, NULL,
666 NULL, NULL, NULL, NULL, NULL); 666 NULL, NULL, NULL, NULL);
667 667
668 if (result != ERROR_SUCCESS) { 668 if (result != ERROR_SUCCESS) {
669 ::RegCloseKey(key_); 669 ::RegCloseKey(key_);
670 key_ = NULL; 670 key_ = NULL;
671 } else { 671 } else {
672 index_ = count - 1; 672 index_ = count - 1;
673 } 673 }
674 } 674 }
675 675
676 Read(); 676 Read();
677 } 677 }
678 678
679 } // namespace win 679 } // namespace win
680 } // namespace base 680 } // namespace base
OLDNEW
« no previous file with comments | « base/win/pe_image.h ('k') | base/win/windows_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698