| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/win/src/interceptors_64.h" | 5 #include "sandbox/win/src/interceptors_64.h" |
| 6 | 6 |
| 7 #include "sandbox/win/src/interceptors.h" | 7 #include "sandbox/win/src/interceptors.h" |
| 8 #include "sandbox/win/src/filesystem_interception.h" | 8 #include "sandbox/win/src/filesystem_interception.h" |
| 9 #include "sandbox/win/src/named_pipe_interception.h" | 9 #include "sandbox/win/src/named_pipe_interception.h" |
| 10 #include "sandbox/win/src/policy_target.h" | 10 #include "sandbox/win/src/policy_target.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 PHANDLE key, ACCESS_MASK desired_access, | 242 PHANDLE key, ACCESS_MASK desired_access, |
| 243 POBJECT_ATTRIBUTES object_attributes, ULONG open_options) { | 243 POBJECT_ATTRIBUTES object_attributes, ULONG open_options) { |
| 244 NtOpenKeyExFunction orig_fn = reinterpret_cast< | 244 NtOpenKeyExFunction orig_fn = reinterpret_cast< |
| 245 NtOpenKeyExFunction>(g_originals[OPEN_KEY_EX_ID]); | 245 NtOpenKeyExFunction>(g_originals[OPEN_KEY_EX_ID]); |
| 246 return TargetNtOpenKeyEx(orig_fn, key, desired_access, object_attributes, | 246 return TargetNtOpenKeyEx(orig_fn, key, desired_access, object_attributes, |
| 247 open_options); | 247 open_options); |
| 248 } | 248 } |
| 249 | 249 |
| 250 // ----------------------------------------------------------------------- | 250 // ----------------------------------------------------------------------- |
| 251 | 251 |
| 252 SANDBOX_INTERCEPT HANDLE WINAPI TargetCreateEventW64( | 252 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenEvent64( |
| 253 LPSECURITY_ATTRIBUTES security_attributes, BOOL manual_reset, | 253 PHANDLE event_handle, DWORD desired_access, |
| 254 BOOL initial_state, LPCWSTR name) { | 254 POBJECT_ATTRIBUTES object_attributes) { |
| 255 CreateEventWFunction orig_fn = reinterpret_cast< | 255 NtOpenEventFunction orig_fn = reinterpret_cast< |
| 256 CreateEventWFunction>(g_originals[CREATE_EVENTW_ID]); | 256 NtOpenEventFunction>(g_originals[OPEN_EVENT_ID]); |
| 257 return TargetCreateEventW(orig_fn, security_attributes, manual_reset, | 257 return TargetNtOpenEvent(orig_fn, event_handle, desired_access, |
| 258 initial_state, name); | 258 object_attributes); |
| 259 } | 259 } |
| 260 | 260 |
| 261 SANDBOX_INTERCEPT HANDLE WINAPI TargetCreateEventA64( | 261 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtCreateEvent64( |
| 262 LPSECURITY_ATTRIBUTES security_attributes, BOOL manual_reset, | 262 PHANDLE event_handle, ACCESS_MASK desired_access, |
| 263 BOOL initial_state, LPCSTR name) { | 263 POBJECT_ATTRIBUTES object_attributes, EVENT_TYPE event_type, |
| 264 CreateEventAFunction orig_fn = reinterpret_cast< | 264 BOOLEAN initial_state) { |
| 265 CreateEventAFunction>(g_originals[CREATE_EVENTA_ID]); | 265 NtCreateEventFunction orig_fn = reinterpret_cast< |
| 266 return TargetCreateEventA(orig_fn, security_attributes, manual_reset, | 266 NtCreateEventFunction>(g_originals[CREATE_EVENT_ID]); |
| 267 initial_state, name); | 267 return TargetNtCreateEvent(orig_fn, event_handle, desired_access, |
| 268 } | 268 object_attributes, event_type, initial_state); |
| 269 | |
| 270 SANDBOX_INTERCEPT HANDLE WINAPI TargetOpenEventW64( | |
| 271 ACCESS_MASK desired_access, BOOL inherit_handle, LPCWSTR name) { | |
| 272 OpenEventWFunction orig_fn = reinterpret_cast< | |
| 273 OpenEventWFunction>(g_originals[OPEN_EVENTW_ID]); | |
| 274 return TargetOpenEventW(orig_fn, desired_access, inherit_handle, name); | |
| 275 } | |
| 276 | |
| 277 SANDBOX_INTERCEPT HANDLE WINAPI TargetOpenEventA64( | |
| 278 ACCESS_MASK desired_access, BOOL inherit_handle, LPCSTR name) { | |
| 279 OpenEventAFunction orig_fn = reinterpret_cast< | |
| 280 OpenEventAFunction>(g_originals[OPEN_EVENTA_ID]); | |
| 281 return TargetOpenEventA(orig_fn, desired_access, inherit_handle, name); | |
| 282 } | 269 } |
| 283 | 270 |
| 284 } // namespace sandbox | 271 } // namespace sandbox |
| OLD | NEW |