| 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/target_services.h" | 5 #include "sandbox/win/src/target_services.h" |
| 6 | 6 |
| 7 #include <new> | 7 #include <new> |
| 8 | 8 |
| 9 #include <process.h> | 9 #include <process.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Cleans up this process if CSRSS will be disconnected, as this disconnection | 50 // Cleans up this process if CSRSS will be disconnected, as this disconnection |
| 51 // is not supported Windows behavior. | 51 // is not supported Windows behavior. |
| 52 // Currently, this step requires closing a heap that this shared with csrss.exe. | 52 // Currently, this step requires closing a heap that this shared with csrss.exe. |
| 53 // Closing the ALPC Port handle to csrss.exe leaves this heap in an invalid | 53 // Closing the ALPC Port handle to csrss.exe leaves this heap in an invalid |
| 54 // state. This causes problems if anyone enumerates the heap. | 54 // state. This causes problems if anyone enumerates the heap. |
| 55 bool CsrssDisconnectCleanup() { | 55 bool CsrssDisconnectCleanup() { |
| 56 HANDLE csr_port_heap = FindCsrPortHeap(); | 56 HANDLE csr_port_heap = FindCsrPortHeap(); |
| 57 if (!csr_port_heap) { | 57 if (!csr_port_heap) { |
| 58 LOG(ERROR) << "Failed to find CSR Port heap handle"; | 58 DLOG(ERROR) << "Failed to find CSR Port heap handle"; |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 HeapDestroy(csr_port_heap); | 61 HeapDestroy(csr_port_heap); |
| 62 return true; | 62 return true; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Checks if we have handle entries pending and runs the closer. | 65 // Checks if we have handle entries pending and runs the closer. |
| 66 // Updates is_csrss_connected based on which handle types are closed. | 66 // Updates is_csrss_connected based on which handle types are closed. |
| 67 bool CloseOpenHandles(bool* is_csrss_connected) { | 67 bool CloseOpenHandles(bool* is_csrss_connected) { |
| 68 if (HandleCloserAgent::NeedsHandlesClosed()) { | 68 if (HandleCloserAgent::NeedsHandlesClosed()) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 void ProcessState::SetRevertedToSelf() { | 258 void ProcessState::SetRevertedToSelf() { |
| 259 if (process_state_ < 3) | 259 if (process_state_ < 3) |
| 260 process_state_ = 3; | 260 process_state_ = 3; |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ProcessState::SetCsrssConnected(bool csrss_connected) { | 263 void ProcessState::SetCsrssConnected(bool csrss_connected) { |
| 264 csrss_connected_ = csrss_connected; | 264 csrss_connected_ = csrss_connected; |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace sandbox | 267 } // namespace sandbox |
| OLD | NEW |