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/named_pipe_dispatcher.h" | 5 #include "sandbox/win/src/named_pipe_dispatcher.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include <stdint.h> |
| 8 |
8 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
9 | 10 |
10 #include "sandbox/win/src/crosscall_client.h" | 11 #include "sandbox/win/src/crosscall_client.h" |
11 #include "sandbox/win/src/interception.h" | 12 #include "sandbox/win/src/interception.h" |
12 #include "sandbox/win/src/interceptors.h" | 13 #include "sandbox/win/src/interceptors.h" |
13 #include "sandbox/win/src/ipc_tags.h" | 14 #include "sandbox/win/src/ipc_tags.h" |
14 #include "sandbox/win/src/named_pipe_interception.h" | 15 #include "sandbox/win/src/named_pipe_interception.h" |
15 #include "sandbox/win/src/named_pipe_policy.h" | 16 #include "sandbox/win/src/named_pipe_policy.h" |
16 #include "sandbox/win/src/policy_broker.h" | 17 #include "sandbox/win/src/policy_broker.h" |
17 #include "sandbox/win/src/policy_params.h" | 18 #include "sandbox/win/src/policy_params.h" |
(...skipping 22 matching lines...) Expand all Loading... |
40 int service) { | 41 int service) { |
41 if (IPC_CREATENAMEDPIPEW_TAG == service) | 42 if (IPC_CREATENAMEDPIPEW_TAG == service) |
42 return INTERCEPT_EAT(manager, kKerneldllName, CreateNamedPipeW, | 43 return INTERCEPT_EAT(manager, kKerneldllName, CreateNamedPipeW, |
43 CREATE_NAMED_PIPE_ID, 36); | 44 CREATE_NAMED_PIPE_ID, 36); |
44 | 45 |
45 return false; | 46 return false; |
46 } | 47 } |
47 | 48 |
48 bool NamedPipeDispatcher::CreateNamedPipe(IPCInfo* ipc, | 49 bool NamedPipeDispatcher::CreateNamedPipe(IPCInfo* ipc, |
49 base::string16* name, | 50 base::string16* name, |
50 uint32 open_mode, | 51 uint32_t open_mode, |
51 uint32 pipe_mode, | 52 uint32_t pipe_mode, |
52 uint32 max_instances, | 53 uint32_t max_instances, |
53 uint32 out_buffer_size, | 54 uint32_t out_buffer_size, |
54 uint32 in_buffer_size, | 55 uint32_t in_buffer_size, |
55 uint32 default_timeout) { | 56 uint32_t default_timeout) { |
56 ipc->return_info.win32_result = ERROR_ACCESS_DENIED; | 57 ipc->return_info.win32_result = ERROR_ACCESS_DENIED; |
57 ipc->return_info.handle = INVALID_HANDLE_VALUE; | 58 ipc->return_info.handle = INVALID_HANDLE_VALUE; |
58 | 59 |
59 base::StringPiece16 dotdot(L".."); | 60 base::StringPiece16 dotdot(L".."); |
60 | 61 |
61 for (const base::StringPiece16& path : base::SplitStringPiece( | 62 for (const base::StringPiece16& path : base::SplitStringPiece( |
62 *name, base::string16(1, '/'), | 63 *name, base::string16(1, '/'), |
63 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { | 64 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
64 for (const base::StringPiece16& inner : base::SplitStringPiece( | 65 for (const base::StringPiece16& inner : base::SplitStringPiece( |
65 path, base::string16(1, '\\'), | 66 path, base::string16(1, '\\'), |
(...skipping 27 matching lines...) Expand all Loading... |
93 out_buffer_size, | 94 out_buffer_size, |
94 in_buffer_size, | 95 in_buffer_size, |
95 default_timeout, &pipe); | 96 default_timeout, &pipe); |
96 | 97 |
97 ipc->return_info.win32_result = ret; | 98 ipc->return_info.win32_result = ret; |
98 ipc->return_info.handle = pipe; | 99 ipc->return_info.handle = pipe; |
99 return true; | 100 return true; |
100 } | 101 } |
101 | 102 |
102 } // namespace sandbox | 103 } // namespace sandbox |
OLD | NEW |