| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/src/process_mitigations_win32k_dispatcher.h" | 5 #include "sandbox/win/src/process_mitigations_win32k_dispatcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 base::SharedMemoryHandle GetSharedMemoryHandle(const ClientInfo& client_info, | 22 base::SharedMemoryHandle GetSharedMemoryHandle(const ClientInfo& client_info, |
| 23 HANDLE handle) { | 23 HANDLE handle) { |
| 24 HANDLE result_handle = nullptr; | 24 HANDLE result_handle = nullptr; |
| 25 intptr_t handle_int = reinterpret_cast<intptr_t>(handle); | 25 intptr_t handle_int = reinterpret_cast<intptr_t>(handle); |
| 26 if (handle_int <= 0 || | 26 if (handle_int <= 0 || |
| 27 !::DuplicateHandle(client_info.process, handle, ::GetCurrentProcess(), | 27 !::DuplicateHandle(client_info.process, handle, ::GetCurrentProcess(), |
| 28 &result_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { | 28 &result_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { |
| 29 result_handle = nullptr; | 29 result_handle = nullptr; |
| 30 } | 30 } |
| 31 return base::SharedMemoryHandle(result_handle, ::GetCurrentProcessId()); | 31 return base::SharedMemoryHandle(result_handle); |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 ProtectedVideoOutput::~ProtectedVideoOutput() { | 36 ProtectedVideoOutput::~ProtectedVideoOutput() { |
| 37 ProcessMitigationsWin32KLockdownPolicy::DestroyOPMProtectedOutputAction( | 37 ProcessMitigationsWin32KLockdownPolicy::DestroyOPMProtectedOutputAction( |
| 38 handle_); | 38 handle_); |
| 39 } | 39 } |
| 40 | 40 |
| 41 scoped_refptr<ProtectedVideoOutput> | 41 scoped_refptr<ProtectedVideoOutput> |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 if (!status) { | 568 if (!status) { |
| 569 memcpy(buffer.memory(), &requested_info, | 569 memcpy(buffer.memory(), &requested_info, |
| 570 sizeof(DXGKMDT_OPM_REQUESTED_INFORMATION)); | 570 sizeof(DXGKMDT_OPM_REQUESTED_INFORMATION)); |
| 571 } | 571 } |
| 572 ipc->return_info.nt_status = status; | 572 ipc->return_info.nt_status = status; |
| 573 return true; | 573 return true; |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace sandbox | 576 } // namespace sandbox |
| 577 | 577 |
| OLD | NEW |