OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/registry.h" | 5 #include "base/win/registry.h" |
6 | 6 |
7 #include <shlwapi.h> | 7 #include <shlwapi.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 #pragma comment(lib, "shlwapi.lib") // for SHDeleteKey | 11 #pragma comment(lib, "shlwapi.lib") // for SHDeleteKey |
12 | 12 |
| 13 namespace base { |
| 14 namespace win { |
| 15 |
13 RegistryValueIterator::RegistryValueIterator(HKEY root_key, | 16 RegistryValueIterator::RegistryValueIterator(HKEY root_key, |
14 const wchar_t* folder_key) { | 17 const wchar_t* folder_key) { |
15 LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_); | 18 LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_); |
16 if (result != ERROR_SUCCESS) { | 19 if (result != ERROR_SUCCESS) { |
17 key_ = NULL; | 20 key_ = NULL; |
18 } else { | 21 } else { |
19 DWORD count = 0; | 22 DWORD count = 0; |
20 result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, NULL, &count, | 23 result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, NULL, &count, |
21 NULL, NULL, NULL, NULL); | 24 NULL, NULL, NULL, NULL); |
22 | 25 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 375 |
373 bool RegKey::HasChanged() { | 376 bool RegKey::HasChanged() { |
374 if (watch_event_) { | 377 if (watch_event_) { |
375 if (WaitForSingleObject(watch_event_, 0) == WAIT_OBJECT_0) { | 378 if (WaitForSingleObject(watch_event_, 0) == WAIT_OBJECT_0) { |
376 StartWatching(); | 379 StartWatching(); |
377 return true; | 380 return true; |
378 } | 381 } |
379 } | 382 } |
380 return false; | 383 return false; |
381 } | 384 } |
| 385 |
| 386 } // namespace win |
| 387 } // namespace base |
OLD | NEW |