OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/sync_dispatcher.h" | 5 #include "sandbox/win/src/sync_dispatcher.h" |
6 | 6 |
7 #include "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
8 #include "sandbox/win/src/crosscall_client.h" | 8 #include "sandbox/win/src/crosscall_client.h" |
9 #include "sandbox/win/src/interception.h" | 9 #include "sandbox/win/src/interception.h" |
10 #include "sandbox/win/src/interceptors.h" | 10 #include "sandbox/win/src/interceptors.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 }; | 30 }; |
31 | 31 |
32 ipc_calls_.push_back(create_params); | 32 ipc_calls_.push_back(create_params); |
33 ipc_calls_.push_back(open_params); | 33 ipc_calls_.push_back(open_params); |
34 } | 34 } |
35 | 35 |
36 bool SyncDispatcher::SetupService(InterceptionManager* manager, | 36 bool SyncDispatcher::SetupService(InterceptionManager* manager, |
37 int service) { | 37 int service) { |
38 bool ret = false; | 38 bool ret = false; |
39 static const wchar_t* kWin32SyncDllName = | 39 static const wchar_t* kWin32SyncDllName = |
40 base::win::GetVersion() >= base::win::VERSION_WIN8 ? kKernelBasedllName : | 40 base::win::GetVersion() >= base::win::VERSION_WIN7 ? kKernelBasedllName : |
41 kKerneldllName; | 41 kKerneldllName; |
42 | 42 |
43 // We need to intercept kernelbase.dll on Windows 8 and beyond and | 43 // We need to intercept kernelbase.dll on Windows 8 and beyond and |
44 // kernel32.dll for earlier versions. | 44 // kernel32.dll for earlier versions. |
45 if (IPC_CREATEEVENT_TAG == service) { | 45 if (IPC_CREATEEVENT_TAG == service) { |
46 ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventW, | 46 ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventW, |
47 CREATE_EVENTW_ID, 20); | 47 CREATE_EVENTW_ID, 20); |
48 if (ret) { | 48 if (ret) { |
49 ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventA, | 49 ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventA, |
50 CREATE_EVENTA_ID, 20); | 50 CREATE_EVENTA_ID, 20); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 DWORD ret = SyncPolicy::OpenEventAction(result, *ipc->client_info, *name, | 92 DWORD ret = SyncPolicy::OpenEventAction(result, *ipc->client_info, *name, |
93 desired_access, inherit_handle, | 93 desired_access, inherit_handle, |
94 &handle); | 94 &handle); |
95 // Return operation status on the IPC. | 95 // Return operation status on the IPC. |
96 ipc->return_info.win32_result = ret; | 96 ipc->return_info.win32_result = ret; |
97 ipc->return_info.handle = handle; | 97 ipc->return_info.handle = handle; |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 } // namespace sandbox | 101 } // namespace sandbox |
OLD | NEW |