| 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 "content/common/sandbox_win.h" | 5 #include "content/common/sandbox_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 OBJECT_BASIC_INFORMATION basic_info; | 424 OBJECT_BASIC_INFORMATION basic_info; |
| 425 size = sizeof(basic_info); | 425 size = sizeof(basic_info); |
| 426 error = g_QueryObject(handle, ObjectBasicInformation, &basic_info, size, | 426 error = g_QueryObject(handle, ObjectBasicInformation, &basic_info, size, |
| 427 &size); | 427 &size); |
| 428 CHECK(NT_SUCCESS(error)); | 428 CHECK(NT_SUCCESS(error)); |
| 429 | 429 |
| 430 CHECK(!(basic_info.GrantedAccess & WRITE_DAC)) << | 430 CHECK(!(basic_info.GrantedAccess & WRITE_DAC)) << |
| 431 kDuplicateHandleWarning; | 431 kDuplicateHandleWarning; |
| 432 | 432 |
| 433 if (0 == _wcsicmp(type_info->Name.Buffer, L"Process")) { | 433 if (0 == _wcsicmp(type_info->Name.Buffer, L"Process")) { |
| 434 const ACCESS_MASK kDangerousMask = ~(PROCESS_QUERY_LIMITED_INFORMATION | | 434 const ACCESS_MASK kDangerousMask = |
| 435 SYNCHRONIZE); | 435 ~static_cast<DWORD>(PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE); |
| 436 CHECK(!(basic_info.GrantedAccess & kDangerousMask)) << | 436 CHECK(!(basic_info.GrantedAccess & kDangerousMask)) << |
| 437 kDuplicateHandleWarning; | 437 kDuplicateHandleWarning; |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 | 440 |
| 441 BOOL WINAPI DuplicateHandlePatch(HANDLE source_process_handle, | 441 BOOL WINAPI DuplicateHandlePatch(HANDLE source_process_handle, |
| 442 HANDLE source_handle, | 442 HANDLE source_handle, |
| 443 HANDLE target_process_handle, | 443 HANDLE target_process_handle, |
| 444 LPHANDLE target_handle, | 444 LPHANDLE target_handle, |
| 445 DWORD desired_access, | 445 DWORD desired_access, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 774 } |
| 775 | 775 |
| 776 return false; | 776 return false; |
| 777 } | 777 } |
| 778 | 778 |
| 779 bool BrokerAddTargetPeer(HANDLE peer_process) { | 779 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 780 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 780 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 781 } | 781 } |
| 782 | 782 |
| 783 } // namespace content | 783 } // namespace content |
| OLD | NEW |