OLD | NEW |
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 "sandbox/src/interceptors_64.h" | 5 #include "sandbox/src/interceptors_64.h" |
6 | 6 |
7 #include "sandbox/src/interceptors.h" | 7 #include "sandbox/src/interceptors.h" |
8 #include "sandbox/src/filesystem_interception.h" | 8 #include "sandbox/src/filesystem_interception.h" |
9 #include "sandbox/src/named_pipe_interception.h" | 9 #include "sandbox/src/named_pipe_interception.h" |
10 #include "sandbox/src/policy_target.h" | 10 #include "sandbox/src/policy_target.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 LPSECURITY_ATTRIBUTES security_attributes) { | 134 LPSECURITY_ATTRIBUTES security_attributes) { |
135 CreateNamedPipeWFunction orig_fn = reinterpret_cast< | 135 CreateNamedPipeWFunction orig_fn = reinterpret_cast< |
136 CreateNamedPipeWFunction>(g_originals[CREATE_NAMED_PIPE_ID]); | 136 CreateNamedPipeWFunction>(g_originals[CREATE_NAMED_PIPE_ID]); |
137 return TargetCreateNamedPipeW(orig_fn, pipe_name, open_mode, pipe_mode, | 137 return TargetCreateNamedPipeW(orig_fn, pipe_name, open_mode, pipe_mode, |
138 max_instance, out_buffer_size, in_buffer_size, | 138 max_instance, out_buffer_size, in_buffer_size, |
139 default_timeout, security_attributes); | 139 default_timeout, security_attributes); |
140 } | 140 } |
141 | 141 |
142 // ----------------------------------------------------------------------- | 142 // ----------------------------------------------------------------------- |
143 | 143 |
144 #if 0 | |
145 // Bug 27218: We don't have IPC yet. | |
146 | |
147 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenThread64( | 144 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenThread64( |
148 PHANDLE thread, ACCESS_MASK desired_access, | 145 PHANDLE thread, ACCESS_MASK desired_access, |
149 POBJECT_ATTRIBUTES object_attributes, PCLIENT_ID client_id) { | 146 POBJECT_ATTRIBUTES object_attributes, PCLIENT_ID client_id) { |
150 NtOpenThreadFunction orig_fn = reinterpret_cast< | 147 NtOpenThreadFunction orig_fn = reinterpret_cast< |
151 NtOpenThreadFunction>(g_originals[OPEN_TREAD_ID]); | 148 NtOpenThreadFunction>(g_originals[OPEN_TREAD_ID]); |
152 return TargetNtOpenThread(orig_fn, thread, desired_access, object_attributes, | 149 return TargetNtOpenThread(orig_fn, thread, desired_access, object_attributes, |
153 client_id); | 150 client_id); |
154 } | 151 } |
155 | 152 |
156 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenProcess64( | 153 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenProcess64( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 CreateProcessAFunction orig_fn = reinterpret_cast< | 199 CreateProcessAFunction orig_fn = reinterpret_cast< |
203 CreateProcessAFunction>(g_originals[CREATE_PROCESSA_ID]); | 200 CreateProcessAFunction>(g_originals[CREATE_PROCESSA_ID]); |
204 return TargetCreateProcessA(orig_fn, application_name, command_line, | 201 return TargetCreateProcessA(orig_fn, application_name, command_line, |
205 process_attributes, thread_attributes, | 202 process_attributes, thread_attributes, |
206 inherit_handles, flags, environment, | 203 inherit_handles, flags, environment, |
207 current_directory, startup_info, | 204 current_directory, startup_info, |
208 process_information); | 205 process_information); |
209 } | 206 } |
210 | 207 |
211 // ----------------------------------------------------------------------- | 208 // ----------------------------------------------------------------------- |
212 | 209 #if 0 |
| 210 // Bug 27218: We don't have IPC yet. |
213 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtCreateKey64( | 211 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtCreateKey64( |
214 PHANDLE key, ACCESS_MASK desired_access, | 212 PHANDLE key, ACCESS_MASK desired_access, |
215 POBJECT_ATTRIBUTES object_attributes, ULONG title_index, | 213 POBJECT_ATTRIBUTES object_attributes, ULONG title_index, |
216 PUNICODE_STRING class_name, ULONG create_options, PULONG disposition) { | 214 PUNICODE_STRING class_name, ULONG create_options, PULONG disposition) { |
217 NtCreateKeyFunction orig_fn = reinterpret_cast< | 215 NtCreateKeyFunction orig_fn = reinterpret_cast< |
218 NtCreateKeyFunction>(g_originals[CREATE_KEY_ID]); | 216 NtCreateKeyFunction>(g_originals[CREATE_KEY_ID]); |
219 return TargetNtCreateKey(orig_fn, key, desired_access, object_attributes, | 217 return TargetNtCreateKey(orig_fn, key, desired_access, object_attributes, |
220 title_index, class_name, create_options, | 218 title_index, class_name, create_options, |
221 disposition); | 219 disposition); |
222 } | 220 } |
(...skipping 29 matching lines...) Expand all Loading... |
252 } | 250 } |
253 | 251 |
254 SANDBOX_INTERCEPT HANDLE WINAPI TargetOpenEventW64( | 252 SANDBOX_INTERCEPT HANDLE WINAPI TargetOpenEventW64( |
255 ACCESS_MASK desired_access, BOOL inherit_handle, LPCWSTR name) { | 253 ACCESS_MASK desired_access, BOOL inherit_handle, LPCWSTR name) { |
256 OpenEventWFunction orig_fn = reinterpret_cast< | 254 OpenEventWFunction orig_fn = reinterpret_cast< |
257 OpenEventWFunction>(g_originals[OPEN_EVENT_ID]); | 255 OpenEventWFunction>(g_originals[OPEN_EVENT_ID]); |
258 return TargetOpenEventW(orig_fn, desired_access, inherit_handle, name); | 256 return TargetOpenEventW(orig_fn, desired_access, inherit_handle, name); |
259 } | 257 } |
260 | 258 |
261 } // namespace sandbox | 259 } // namespace sandbox |
OLD | NEW |