OLD | NEW |
1 // Copyright (c) 2006-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 <map> | 5 #include <map> |
6 | 6 |
7 #include "sandbox/src/policy_broker.h" | 7 #include "sandbox/src/policy_broker.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/pe_image.h" | 10 #include "base/pe_image.h" |
11 #include "base/win_util.h" | 11 #include "base/win/windows_version.h" |
12 #include "sandbox/src/interception.h" | 12 #include "sandbox/src/interception.h" |
13 #include "sandbox/src/interceptors.h" | 13 #include "sandbox/src/interceptors.h" |
14 #include "sandbox/src/policy_target.h" | 14 #include "sandbox/src/policy_target.h" |
15 #include "sandbox/src/process_thread_interception.h" | 15 #include "sandbox/src/process_thread_interception.h" |
16 #include "sandbox/src/sandbox.h" | 16 #include "sandbox/src/sandbox.h" |
17 #include "sandbox/src/sandbox_nt_types.h" | 17 #include "sandbox/src/sandbox_nt_types.h" |
18 #include "sandbox/src/sandbox_types.h" | 18 #include "sandbox/src/sandbox_types.h" |
19 #include "sandbox/src/sandbox_utils.h" | 19 #include "sandbox/src/sandbox_utils.h" |
20 #include "sandbox/src/target_process.h" | 20 #include "sandbox/src/target_process.h" |
21 | 21 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 !INTERCEPT_NT(manager, NtOpenProcess, OPEN_PROCESS_ID, 20) || | 93 !INTERCEPT_NT(manager, NtOpenProcess, OPEN_PROCESS_ID, 20) || |
94 !INTERCEPT_NT(manager, NtOpenProcessToken, OPEN_PROCESS_TOKEN_ID, 16)) | 94 !INTERCEPT_NT(manager, NtOpenProcessToken, OPEN_PROCESS_TOKEN_ID, 16)) |
95 return false; | 95 return false; |
96 | 96 |
97 // Interceptions with neither policy nor IPC. | 97 // Interceptions with neither policy nor IPC. |
98 if (!INTERCEPT_NT(manager, NtSetInformationThread, SET_INFORMATION_THREAD_ID, | 98 if (!INTERCEPT_NT(manager, NtSetInformationThread, SET_INFORMATION_THREAD_ID, |
99 20) || | 99 20) || |
100 !INTERCEPT_NT(manager, NtOpenThreadToken, OPEN_THREAD_TOKEN_ID, 20)) | 100 !INTERCEPT_NT(manager, NtOpenThreadToken, OPEN_THREAD_TOKEN_ID, 20)) |
101 return false; | 101 return false; |
102 | 102 |
103 if (win_util::GetWinVersion() >= win_util::WINVERSION_XP) { | 103 if (base::win::GetVersion() >= base::win::VERSION_XP) { |
104 // Bug 27218: We don't have dispatch for some x64 syscalls. | 104 // Bug 27218: We don't have dispatch for some x64 syscalls. |
105 // This one is also provided by process_thread_policy. | 105 // This one is also provided by process_thread_policy. |
106 if (!INTERCEPT_NT(manager, NtOpenProcessTokenEx, OPEN_PROCESS_TOKEN_EX_ID, | 106 if (!INTERCEPT_NT(manager, NtOpenProcessTokenEx, OPEN_PROCESS_TOKEN_EX_ID, |
107 20)) | 107 20)) |
108 return false; | 108 return false; |
109 | 109 |
110 return INTERCEPT_NT(manager, NtOpenThreadTokenEx, OPEN_THREAD_TOKEN_EX_ID, | 110 return INTERCEPT_NT(manager, NtOpenThreadTokenEx, OPEN_THREAD_TOKEN_EX_ID, |
111 24); | 111 24); |
112 } | 112 } |
113 | 113 |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 } // namespace sandbox | 117 } // namespace sandbox |
OLD | NEW |