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 DWORD last_error = ERROR_SUCCESS; |
518 &target_); | 518 sandbox::ResultCode result = |
| 519 broker_->SpawnTarget(spawn_target_.c_str(), arguments, policy, |
| 520 &warning_result, &last_error, &target_); |
519 | 521 |
520 policy->Release(); | 522 policy->Release(); |
521 policy = NULL; | 523 policy = NULL; |
522 | 524 |
523 bool return_value = false; | 525 bool return_value = false; |
524 if (sandbox::SBOX_ALL_OK != result) { | 526 if (sandbox::SBOX_ALL_OK != result) { |
525 AddDebugMessage( | 527 AddDebugMessage( |
526 L"Failed to spawn target %ls w/args (%ls), sandbox error code: %d", | 528 L"Failed to spawn target %ls w/args (%ls), sandbox error code: %d", |
527 spawn_target_.c_str(), arguments, result); | 529 spawn_target_.c_str(), arguments, result); |
528 return_value = false; | 530 return_value = false; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 item.iItem = ListView_GetItemCount(list_view_); | 656 item.iItem = ListView_GetItemCount(list_view_); |
655 item.iSubItem = 0; | 657 item.iSubItem = 0; |
656 item.mask = LVIF_TEXT | LVIF_PARAM; | 658 item.mask = LVIF_TEXT | LVIF_PARAM; |
657 item.pszText = message_time; | 659 item.pszText = message_time; |
658 item.lParam = 0; | 660 item.lParam = 0; |
659 | 661 |
660 ListView_InsertItem(list_view_, &item); | 662 ListView_InsertItem(list_view_, &item); |
661 | 663 |
662 delete[] message_time; | 664 delete[] message_time; |
663 } | 665 } |
OLD | NEW |