| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/named_pipe_policy.h" | 5 #include "sandbox/win/src/named_pipe_policy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "sandbox/win/src/ipc_tags.h" | 9 #include "sandbox/win/src/ipc_tags.h" |
| 10 #include "sandbox/win/src/policy_engine_opcodes.h" | 10 #include "sandbox/win/src/policy_engine_opcodes.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 if (!policy->AddRule(IPC_CREATENAMEDPIPEW_TAG, &pipe)) { | 55 if (!policy->AddRule(IPC_CREATENAMEDPIPEW_TAG, &pipe)) { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| 60 | 60 |
| 61 DWORD NamedPipePolicy::CreateNamedPipeAction(EvalResult eval_result, | 61 DWORD NamedPipePolicy::CreateNamedPipeAction(EvalResult eval_result, |
| 62 const ClientInfo& client_info, | 62 const ClientInfo& client_info, |
| 63 const std::wstring &name, | 63 const base::string16 &name, |
| 64 DWORD open_mode, DWORD pipe_mode, | 64 DWORD open_mode, DWORD pipe_mode, |
| 65 DWORD max_instances, | 65 DWORD max_instances, |
| 66 DWORD out_buffer_size, | 66 DWORD out_buffer_size, |
| 67 DWORD in_buffer_size, | 67 DWORD in_buffer_size, |
| 68 DWORD default_timeout, | 68 DWORD default_timeout, |
| 69 HANDLE* pipe) { | 69 HANDLE* pipe) { |
| 70 // The only action supported is ASK_BROKER which means create the pipe. | 70 // The only action supported is ASK_BROKER which means create the pipe. |
| 71 if (ASK_BROKER != eval_result) { | 71 if (ASK_BROKER != eval_result) { |
| 72 return ERROR_ACCESS_DENIED; | 72 return ERROR_ACCESS_DENIED; |
| 73 } | 73 } |
| 74 | 74 |
| 75 *pipe = CreateNamedPipeHelper(client_info.process, name.c_str(), | 75 *pipe = CreateNamedPipeHelper(client_info.process, name.c_str(), |
| 76 open_mode, pipe_mode, max_instances, | 76 open_mode, pipe_mode, max_instances, |
| 77 out_buffer_size, in_buffer_size, | 77 out_buffer_size, in_buffer_size, |
| 78 default_timeout, NULL); | 78 default_timeout, NULL); |
| 79 | 79 |
| 80 if (INVALID_HANDLE_VALUE == *pipe) | 80 if (INVALID_HANDLE_VALUE == *pipe) |
| 81 return ERROR_ACCESS_DENIED; | 81 return ERROR_ACCESS_DENIED; |
| 82 | 82 |
| 83 return ERROR_SUCCESS; | 83 return ERROR_SUCCESS; |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace sandbox | 86 } // namespace sandbox |
| OLD | NEW |