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 #ifndef BASE_WIN_REGISTRY_H_ | 5 #ifndef BASE_WIN_REGISTRY_H_ |
6 #define BASE_WIN_REGISTRY_H_ | 6 #define BASE_WIN_REGISTRY_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 125 |
126 // Will automatically be called by destructor if not manually called | 126 // Will automatically be called by destructor if not manually called |
127 // beforehand. Returns true if it was watching, false otherwise. | 127 // beforehand. Returns true if it was watching, false otherwise. |
128 LONG StopWatching(); | 128 LONG StopWatching(); |
129 | 129 |
130 inline bool IsWatching() const { return watch_event_ != 0; } | 130 inline bool IsWatching() const { return watch_event_ != 0; } |
131 HANDLE watch_event() const { return watch_event_; } | 131 HANDLE watch_event() const { return watch_event_; } |
132 HKEY Handle() const { return key_; } | 132 HKEY Handle() const { return key_; } |
133 | 133 |
134 private: | 134 private: |
135 // Wrapper function for RegDeleteKeyEx which is not supported on all | |
grt (UTC plus 2)
2014/05/17 12:54:33
Please make the comments descriptive as per the st
Will Harris
2014/05/19 21:49:03
Done.
| |
136 // platforms. Behaves like RegDeleteKeyEx. | |
137 static LONG RegDeleteKeyExWrapper(HKEY hKey, | |
138 const wchar_t* lpSubKey, | |
139 REGSAM samDesired, | |
140 DWORD Reserved); | |
141 | |
142 // Internal function to perform a recursive registry key delete. | |
grt (UTC plus 2)
2014/05/17 12:54:33
suggestion:
// Recursively deletes a key and all
Will Harris
2014/05/19 21:49:03
Done.
| |
143 static LONG RegDelRecurse(HKEY root_key, | |
144 std::wstring const& name, | |
grt (UTC plus 2)
2014/05/17 12:54:33
const std::wstring&
Will Harris
2014/05/19 21:49:03
Done.
| |
145 REGSAM access); | |
135 HKEY key_; // The registry key being iterated. | 146 HKEY key_; // The registry key being iterated. |
136 HANDLE watch_event_; | 147 HANDLE watch_event_; |
148 REGSAM wow64access_; | |
137 | 149 |
138 DISALLOW_COPY_AND_ASSIGN(RegKey); | 150 DISALLOW_COPY_AND_ASSIGN(RegKey); |
139 }; | 151 }; |
140 | 152 |
141 // Iterates the entries found in a particular folder on the registry. | 153 // Iterates the entries found in a particular folder on the registry. |
142 class BASE_EXPORT RegistryValueIterator { | 154 class BASE_EXPORT RegistryValueIterator { |
143 public: | 155 public: |
144 RegistryValueIterator(HKEY root_key, const wchar_t* folder_key); | 156 RegistryValueIterator(HKEY root_key, const wchar_t* folder_key); |
145 | 157 |
146 ~RegistryValueIterator(); | 158 ~RegistryValueIterator(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 | 222 |
211 wchar_t name_[MAX_PATH]; | 223 wchar_t name_[MAX_PATH]; |
212 | 224 |
213 DISALLOW_COPY_AND_ASSIGN(RegistryKeyIterator); | 225 DISALLOW_COPY_AND_ASSIGN(RegistryKeyIterator); |
214 }; | 226 }; |
215 | 227 |
216 } // namespace win | 228 } // namespace win |
217 } // namespace base | 229 } // namespace base |
218 | 230 |
219 #endif // BASE_WIN_REGISTRY_H_ | 231 #endif // BASE_WIN_REGISTRY_H_ |
OLD | NEW |