OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "sandbox/sandbox_poc/pocdll/exports.h" | 5 #include "sandbox/win/sandbox_poc/pocdll/exports.h" |
6 #include "sandbox/sandbox_poc/pocdll/utils.h" | 6 #include "sandbox/win/sandbox_poc/pocdll/utils.h" |
7 | 7 |
8 // This file contains the tests used to verify the security of the registry. | 8 // This file contains the tests used to verify the security of the registry. |
9 | 9 |
10 // Converts an HKEY to a string. This is using the lazy way and works only | 10 // Converts an HKEY to a string. This is using the lazy way and works only |
11 // for the main hives. | 11 // for the main hives. |
12 // "key" is the hive to convert to string. | 12 // "key" is the hive to convert to string. |
13 // The return value is the string corresponding to the hive or "unknown" | 13 // The return value is the string corresponding to the hive or "unknown" |
14 const wchar_t *HKEYToString(const HKEY key) { | 14 const wchar_t *HKEYToString(const HKEY key) { |
15 switch (reinterpret_cast<LONG_PTR>(key)) { | 15 switch (reinterpret_cast<LONG_PTR>(key)) { |
16 case HKEY_CLASSES_ROOT: | 16 case HKEY_CLASSES_ROOT: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 HandleToFile handle2file; | 54 HandleToFile handle2file; |
55 FILE *output = handle2file.Translate(log, "w"); | 55 FILE *output = handle2file.Translate(log, "w"); |
56 | 56 |
57 TryOpenKey(HKEY_LOCAL_MACHINE, NULL, output); | 57 TryOpenKey(HKEY_LOCAL_MACHINE, NULL, output); |
58 TryOpenKey(HKEY_CURRENT_USER, NULL, output); | 58 TryOpenKey(HKEY_CURRENT_USER, NULL, output); |
59 TryOpenKey(HKEY_USERS, NULL, output); | 59 TryOpenKey(HKEY_USERS, NULL, output); |
60 TryOpenKey(HKEY_LOCAL_MACHINE, | 60 TryOpenKey(HKEY_LOCAL_MACHINE, |
61 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", | 61 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", |
62 output); | 62 output); |
63 } | 63 } |
OLD | NEW |