| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |