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 <stddef.h> |
8 #include <algorithm> | 9 #include <algorithm> |
9 | 10 |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" |
11 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
12 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
13 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
14 | 16 |
15 namespace base { | 17 namespace base { |
16 namespace win { | 18 namespace win { |
17 | 19 |
18 namespace { | 20 namespace { |
19 | 21 |
20 // RegEnumValue() reports the number of characters from the name that were | 22 // RegEnumValue() reports the number of characters from the name that were |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (result == ERROR_SUCCESS) { | 296 if (result == ERROR_SUCCESS) { |
295 if ((type == REG_DWORD || type == REG_BINARY) && size == sizeof(DWORD)) | 297 if ((type == REG_DWORD || type == REG_BINARY) && size == sizeof(DWORD)) |
296 *out_value = local_value; | 298 *out_value = local_value; |
297 else | 299 else |
298 result = ERROR_CANTREAD; | 300 result = ERROR_CANTREAD; |
299 } | 301 } |
300 | 302 |
301 return result; | 303 return result; |
302 } | 304 } |
303 | 305 |
304 LONG RegKey::ReadInt64(const wchar_t* name, int64* out_value) const { | 306 LONG RegKey::ReadInt64(const wchar_t* name, int64_t* out_value) const { |
305 DCHECK(out_value); | 307 DCHECK(out_value); |
306 DWORD type = REG_QWORD; | 308 DWORD type = REG_QWORD; |
307 int64 local_value = 0; | 309 int64_t local_value = 0; |
308 DWORD size = sizeof(local_value); | 310 DWORD size = sizeof(local_value); |
309 LONG result = ReadValue(name, &local_value, &size, &type); | 311 LONG result = ReadValue(name, &local_value, &size, &type); |
310 if (result == ERROR_SUCCESS) { | 312 if (result == ERROR_SUCCESS) { |
311 if ((type == REG_QWORD || type == REG_BINARY) && | 313 if ((type == REG_QWORD || type == REG_BINARY) && |
312 size == sizeof(local_value)) | 314 size == sizeof(local_value)) |
313 *out_value = local_value; | 315 *out_value = local_value; |
314 else | 316 else |
315 result = ERROR_CANTREAD; | 317 result = ERROR_CANTREAD; |
316 } | 318 } |
317 | 319 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 } else { | 673 } else { |
672 index_ = count - 1; | 674 index_ = count - 1; |
673 } | 675 } |
674 } | 676 } |
675 | 677 |
676 Read(); | 678 Read(); |
677 } | 679 } |
678 | 680 |
679 } // namespace win | 681 } // namespace win |
680 } // namespace base | 682 } // namespace base |
OLD | NEW |