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/src/sandbox_policy_base.h" | 5 #include "sandbox/win/src/sandbox_policy_base.h" |
6 | 6 |
7 #include <sddl.h> | 7 #include <sddl.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 ResultCode PolicyBase::AddDllToUnload(const wchar_t* dll_name) { | 416 ResultCode PolicyBase::AddDllToUnload(const wchar_t* dll_name) { |
417 blacklisted_dlls_.push_back(dll_name); | 417 blacklisted_dlls_.push_back(dll_name); |
418 return SBOX_ALL_OK; | 418 return SBOX_ALL_OK; |
419 } | 419 } |
420 | 420 |
421 ResultCode PolicyBase::AddKernelObjectToClose(const base::char16* handle_type, | 421 ResultCode PolicyBase::AddKernelObjectToClose(const base::char16* handle_type, |
422 const base::char16* handle_name) { | 422 const base::char16* handle_name) { |
423 return handle_closer_.AddHandle(handle_type, handle_name); | 423 return handle_closer_.AddHandle(handle_type, handle_name); |
424 } | 424 } |
425 | 425 |
| 426 void PolicyBase::AddHandleToShare(HANDLE handle) { |
| 427 handles_to_share_.push_back(handle); |
| 428 } |
| 429 |
| 430 HandleList PolicyBase::GetHandlesBeingShared() { |
| 431 return handles_to_share_; |
| 432 } |
| 433 |
426 // When an IPC is ready in any of the targets we get called. We manage an array | 434 // When an IPC is ready in any of the targets we get called. We manage an array |
427 // of IPC dispatchers which are keyed on the IPC tag so we normally delegate | 435 // of IPC dispatchers which are keyed on the IPC tag so we normally delegate |
428 // to the appropriate dispatcher unless we can handle the IPC call ourselves. | 436 // to the appropriate dispatcher unless we can handle the IPC call ourselves. |
429 Dispatcher* PolicyBase::OnMessageReady(IPCParams* ipc, | 437 Dispatcher* PolicyBase::OnMessageReady(IPCParams* ipc, |
430 CallbackGeneric* callback) { | 438 CallbackGeneric* callback) { |
431 DCHECK(callback); | 439 DCHECK(callback); |
432 static const IPCParams ping1 = {IPC_PING1_TAG, UINT32_TYPE}; | 440 static const IPCParams ping1 = {IPC_PING1_TAG, UINT32_TYPE}; |
433 static const IPCParams ping2 = {IPC_PING2_TAG, INOUTPTR_TYPE}; | 441 static const IPCParams ping2 = {IPC_PING2_TAG, INOUTPTR_TYPE}; |
434 | 442 |
435 if (ping1.Matches(ipc) || ping2.Matches(ipc)) { | 443 if (ping1.Matches(ipc) || ping2.Matches(ipc)) { |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 break; | 803 break; |
796 } | 804 } |
797 | 805 |
798 default: { return SBOX_ERROR_UNSUPPORTED; } | 806 default: { return SBOX_ERROR_UNSUPPORTED; } |
799 } | 807 } |
800 | 808 |
801 return SBOX_ALL_OK; | 809 return SBOX_ALL_OK; |
802 } | 810 } |
803 | 811 |
804 } // namespace sandbox | 812 } // namespace sandbox |
OLD | NEW |