OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/callback.h" | 5 #include "base/callback.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "sandbox/win/src/sharedmem_ipc_server.h" | 8 #include "sandbox/win/src/sharedmem_ipc_server.h" |
9 #include "sandbox/win/src/sharedmem_ipc_client.h" | 9 #include "sandbox/win/src/sharedmem_ipc_client.h" |
10 #include "sandbox/win/src/sandbox.h" | 10 #include "sandbox/win/src/sandbox.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // of the message so the client cannot play dirty tricks by changing the | 223 // of the message so the client cannot play dirty tricks by changing the |
224 // data in the channel while the IPC is being processed. | 224 // data in the channel while the IPC is being processed. |
225 scoped_ptr<CrossCallParamsEx> params( | 225 scoped_ptr<CrossCallParamsEx> params( |
226 CrossCallParamsEx::CreateFromBuffer(ipc_buffer, | 226 CrossCallParamsEx::CreateFromBuffer(ipc_buffer, |
227 service_context->channel_size, | 227 service_context->channel_size, |
228 &output_size)); | 228 &output_size)); |
229 if (!params.get()) | 229 if (!params.get()) |
230 return false; | 230 return false; |
231 | 231 |
232 uint32 tag = params->GetTag(); | 232 uint32 tag = params->GetTag(); |
233 COMPILE_ASSERT(0 == INVALID_TYPE, Incorrect_type_enum); | 233 static_assert(0 == INVALID_TYPE, "incorrect type enum"); |
234 IPCParams ipc_params = {0}; | 234 IPCParams ipc_params = {0}; |
235 ipc_params.ipc_tag = tag; | 235 ipc_params.ipc_tag = tag; |
236 | 236 |
237 void* args[kMaxIpcParams]; | 237 void* args[kMaxIpcParams]; |
238 if (!GetArgs(params.get(), &ipc_params, args)) | 238 if (!GetArgs(params.get(), &ipc_params, args)) |
239 return false; | 239 return false; |
240 | 240 |
241 IPCInfo ipc_info = {0}; | 241 IPCInfo ipc_info = {0}; |
242 ipc_info.ipc_tag = tag; | 242 ipc_info.ipc_tag = tag; |
243 ipc_info.client_info = &service_context->target_info; | 243 ipc_info.client_info = &service_context->target_info; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 *server_pong = ::CreateEventW(NULL, FALSE, FALSE, NULL); | 412 *server_pong = ::CreateEventW(NULL, FALSE, FALSE, NULL); |
413 if (!::DuplicateHandle(::GetCurrentProcess(), *server_pong, target_process_, | 413 if (!::DuplicateHandle(::GetCurrentProcess(), *server_pong, target_process_, |
414 client_pong, kDesiredAccess, FALSE, 0)) { | 414 client_pong, kDesiredAccess, FALSE, 0)) { |
415 return false; | 415 return false; |
416 } | 416 } |
417 return true; | 417 return true; |
418 } | 418 } |
419 | 419 |
420 } // namespace sandbox | 420 } // namespace sandbox |
OLD | NEW |