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 "sandbox/win/tests/common/controller.h" | 5 #include "sandbox/win/tests/common/controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 TargetServices* target = SandboxFactory::GetTargetServices(); | 318 TargetServices* target = SandboxFactory::GetTargetServices(); |
319 if (target) { | 319 if (target) { |
320 if (SBOX_ALL_OK != target->Init()) | 320 if (SBOX_ALL_OK != target->Init()) |
321 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; | 321 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |
322 | 322 |
323 if (BEFORE_REVERT == state) | 323 if (BEFORE_REVERT == state) |
324 return command(argc - 4, argv + 4); | 324 return command(argc - 4, argv + 4); |
325 else if (EVERY_STATE == state) | 325 else if (EVERY_STATE == state) |
326 command(argc - 4, argv + 4); | 326 command(argc - 4, argv + 4); |
327 | 327 |
| 328 #if defined(ADDRESS_SANITIZER) |
| 329 // Bind and leak dbghelp.dll before the token is lowered, otherwise |
| 330 // AddressSanitizer will crash when trying to symbolize a report. |
| 331 if (!LoadLibraryA("dbghelp.dll")) |
| 332 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |
| 333 #endif |
| 334 |
328 target->LowerToken(); | 335 target->LowerToken(); |
329 } else if (0 != _wcsicmp(argv[1], L"-child-no-sandbox")) { | 336 } else if (0 != _wcsicmp(argv[1], L"-child-no-sandbox")) { |
330 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; | 337 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |
331 } | 338 } |
332 | 339 |
333 return command(argc - 4, argv + 4); | 340 return command(argc - 4, argv + 4); |
334 } | 341 } |
335 | 342 |
336 } // namespace sandbox | 343 } // namespace sandbox |
OLD | NEW |