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

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

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/win/registry.h ('k') | base/win/registry_unittest.cc » ('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) 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
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
OLDNEW
« no previous file with comments | « base/win/registry.h ('k') | base/win/registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698