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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "sandbox/win/src/crosscall_server.h" | 8 #include "sandbox/win/src/crosscall_server.h" |
9 #include "sandbox/win/src/crosscall_params.h" | 9 #include "sandbox/win/src/crosscall_params.h" |
10 #include "sandbox/win/src/crosscall_client.h" | 10 #include "sandbox/win/src/crosscall_client.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 void* start = GetRawParameter(index, &size, &type); | 230 void* start = GetRawParameter(index, &size, &type); |
231 if ((NULL == start) || (sizeof(void*) != size) || (VOIDPTR_TYPE != type)) { | 231 if ((NULL == start) || (sizeof(void*) != size) || (VOIDPTR_TYPE != type)) { |
232 return false; | 232 return false; |
233 } | 233 } |
234 *param = *(reinterpret_cast<void**>(start)); | 234 *param = *(reinterpret_cast<void**>(start)); |
235 return true; | 235 return true; |
236 } | 236 } |
237 | 237 |
238 // Covers the common case of reading a string. Note that the string is not | 238 // Covers the common case of reading a string. Note that the string is not |
239 // scanned for invalid characters. | 239 // scanned for invalid characters. |
240 bool CrossCallParamsEx::GetParameterStr(uint32 index, std::wstring* string) { | 240 bool CrossCallParamsEx::GetParameterStr(uint32 index, base::string16* string) { |
241 uint32 size = 0; | 241 uint32 size = 0; |
242 ArgType type; | 242 ArgType type; |
243 void* start = GetRawParameter(index, &size, &type); | 243 void* start = GetRawParameter(index, &size, &type); |
244 if (WCHAR_TYPE != type) { | 244 if (WCHAR_TYPE != type) { |
245 return false; | 245 return false; |
246 } | 246 } |
247 | 247 |
248 // Check if this is an empty string. | 248 // Check if this is an empty string. |
249 if (size == 0) { | 249 if (size == 0) { |
250 *string = L""; | 250 *string = L""; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 for (; it != ipc_calls_.end(); ++it) { | 292 for (; it != ipc_calls_.end(); ++it) { |
293 if (it->params.Matches(ipc)) { | 293 if (it->params.Matches(ipc)) { |
294 *callback = it->callback; | 294 *callback = it->callback; |
295 return this; | 295 return this; |
296 } | 296 } |
297 } | 297 } |
298 return NULL; | 298 return NULL; |
299 } | 299 } |
300 | 300 |
301 } // namespace sandbox | 301 } // namespace sandbox |
OLD | NEW |