15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "sandbox/win/src/nt_internals.h" 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "sandbox/win/src/sandbox_types.h" 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef SANDBOX_SRC_SYNC_INTERCEPTION_H__ 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define SANDBOX_SRC_SYNC_INTERCEPTION_H__ 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace sandbox { 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern "C" { 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)typedef NTSTATUS (WINAPI* NtCreateEventFunction) ( 161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) PHANDLE EventHandle, 171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ACCESS_MASK DesiredAccess, 181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) POBJECT_ATTRIBUTES ObjectAttributes, 191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) EVENT_TYPE EventType, 201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) BOOLEAN InitialState); 211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)typedef NTSTATUS (WINAPI *NtOpenEventFunction) ( 231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) PHANDLE EventHandle, 241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ACCESS_MASK DesiredAccess, 251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) POBJECT_ATTRIBUTES ObjectAttributes); 261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Interceptors for NtCreateEvent/NtOpenEvent 281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtCreateEvent( 291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) NtCreateEventFunction orig_CreateEvent, 301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) PHANDLE event_handle, 311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ACCESS_MASK desired_access, 321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) POBJECT_ATTRIBUTES object_attributes, 331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) EVENT_TYPE event_type, 341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) BOOLEAN initial_state); 351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenEvent( 371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) NtOpenEventFunction orig_OpenEvent, 381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) PHANDLE event_handle, 391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ACCESS_MASK desired_access, 401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) POBJECT_ATTRIBUTES object_attributes); 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // extern "C" 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace sandbox 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // SANDBOX_SRC_SYNC_INTERCEPTION_H__ 47