| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/process_mitigations.h" | 5 #include "sandbox/win/src/process_mitigations.h" |
| 6 | 6 |
| 7 #include <d3d9.h> | 7 #include <d3d9.h> |
| 8 #include <initguid.h> | 8 #include <initguid.h> |
| 9 #include <opmapi.h> | 9 #include <opmapi.h> |
| 10 #include <psapi.h> | 10 #include <psapi.h> |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 void TestWin10ImageLoadLowLabel(bool is_success_test) { | 471 void TestWin10ImageLoadLowLabel(bool is_success_test) { |
| 472 // Setup a mandatory low executable for this test (calc.exe). | 472 // Setup a mandatory low executable for this test (calc.exe). |
| 473 // If anything fails during setup, ASSERT to end test. | 473 // If anything fails during setup, ASSERT to end test. |
| 474 base::FilePath orig_path; | 474 base::FilePath orig_path; |
| 475 ASSERT_TRUE(base::PathService::Get(base::DIR_SYSTEM, &orig_path)); | 475 ASSERT_TRUE(base::PathService::Get(base::DIR_SYSTEM, &orig_path)); |
| 476 orig_path = orig_path.Append(L"calc.exe"); | 476 orig_path = orig_path.Append(L"calc.exe"); |
| 477 | 477 |
| 478 base::ScopedTempDir temp_dir; | 478 base::ScopedTempDir temp_dir; |
| 479 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 479 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 480 base::FilePath new_path = temp_dir.path(); | 480 base::FilePath new_path = temp_dir.GetPath(); |
| 481 new_path = new_path.Append(L"lowIL_calc.exe"); | 481 new_path = new_path.Append(L"lowIL_calc.exe"); |
| 482 | 482 |
| 483 // Test file will be cleaned up by the ScopedTempDir. | 483 // Test file will be cleaned up by the ScopedTempDir. |
| 484 ASSERT_TRUE(base::CopyFileW(orig_path, new_path)); | 484 ASSERT_TRUE(base::CopyFileW(orig_path, new_path)); |
| 485 | 485 |
| 486 std::wstring cmd_line = L"icacls \""; | 486 std::wstring cmd_line = L"icacls \""; |
| 487 cmd_line += new_path.value().c_str(); | 487 cmd_line += new_path.value().c_str(); |
| 488 cmd_line += L"\" /setintegritylevel Low"; | 488 cmd_line += L"\" /setintegritylevel Low"; |
| 489 | 489 |
| 490 base::LaunchOptions options = base::LaunchOptionsForTest(); | 490 base::LaunchOptions options = base::LaunchOptionsForTest(); |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 cmd = cmd.Append(L"calc.exe"); | 1803 cmd = cmd.Append(L"calc.exe"); |
| 1804 | 1804 |
| 1805 std::wstring test_command(base::StringPrintf(L"TestChildProcess %ls 0x%08X", | 1805 std::wstring test_command(base::StringPrintf(L"TestChildProcess %ls 0x%08X", |
| 1806 cmd.value().c_str(), | 1806 cmd.value().c_str(), |
| 1807 STATUS_ACCESS_VIOLATION)); | 1807 STATUS_ACCESS_VIOLATION)); |
| 1808 | 1808 |
| 1809 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(test_command.c_str())); | 1809 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(test_command.c_str())); |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 } // namespace sandbox | 1812 } // namespace sandbox |
| OLD | NEW |