| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/sandbox_poc/main_ui_window.h" | 5 #include "sandbox/win/sandbox_poc/main_ui_window.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <CommCtrl.h> | 8 #include <CommCtrl.h> |
| 9 #include <commdlg.h> | 9 #include <commdlg.h> |
| 10 #include <stdarg.h> | 10 #include <stdarg.h> |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 sandbox::USER_LOCKDOWN); | 506 sandbox::USER_LOCKDOWN); |
| 507 policy->SetAlternateDesktop(true); | 507 policy->SetAlternateDesktop(true); |
| 508 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); | 508 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); |
| 509 | 509 |
| 510 // Set the rule to allow the POC dll to be loaded by the target. Note that | 510 // Set the rule to allow the POC dll to be loaded by the target. Note that |
| 511 // the rule allows 'all access' to the DLL, which could mean that the target | 511 // the rule allows 'all access' to the DLL, which could mean that the target |
| 512 // could modify the DLL on disk. | 512 // could modify the DLL on disk. |
| 513 policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 513 policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 514 sandbox::TargetPolicy::FILES_ALLOW_ANY, dll_path_.c_str()); | 514 sandbox::TargetPolicy::FILES_ALLOW_ANY, dll_path_.c_str()); |
| 515 | 515 |
| 516 sandbox::ResultCode result = broker_->SpawnTarget(spawn_target_.c_str(), | 516 sandbox::ResultCode warning_result = sandbox::SBOX_ALL_OK; |
| 517 arguments, policy, | 517 sandbox::ResultCode result = broker_->SpawnTarget( |
| 518 &target_); | 518 spawn_target_.c_str(), arguments, policy, &warning_result, &target_); |
| 519 | 519 |
| 520 policy->Release(); | 520 policy->Release(); |
| 521 policy = NULL; | 521 policy = NULL; |
| 522 | 522 |
| 523 bool return_value = false; | 523 bool return_value = false; |
| 524 if (sandbox::SBOX_ALL_OK != result) { | 524 if (sandbox::SBOX_ALL_OK != result) { |
| 525 AddDebugMessage( | 525 AddDebugMessage( |
| 526 L"Failed to spawn target %ls w/args (%ls), sandbox error code: %d", | 526 L"Failed to spawn target %ls w/args (%ls), sandbox error code: %d", |
| 527 spawn_target_.c_str(), arguments, result); | 527 spawn_target_.c_str(), arguments, result); |
| 528 return_value = false; | 528 return_value = false; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 item.iItem = ListView_GetItemCount(list_view_); | 654 item.iItem = ListView_GetItemCount(list_view_); |
| 655 item.iSubItem = 0; | 655 item.iSubItem = 0; |
| 656 item.mask = LVIF_TEXT | LVIF_PARAM; | 656 item.mask = LVIF_TEXT | LVIF_PARAM; |
| 657 item.pszText = message_time; | 657 item.pszText = message_time; |
| 658 item.lParam = 0; | 658 item.lParam = 0; |
| 659 | 659 |
| 660 ListView_InsertItem(list_view_, &item); | 660 ListView_InsertItem(list_view_, &item); |
| 661 | 661 |
| 662 delete[] message_time; | 662 delete[] message_time; |
| 663 } | 663 } |
| OLD | NEW |