| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/src/handle_closer.h" | 5 #include "sandbox/win/src/handle_closer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "sandbox/src/interceptors.h" | 10 #include "sandbox/win/src/interceptors.h" |
| 11 #include "sandbox/src/internal_types.h" | 11 #include "sandbox/win/src/internal_types.h" |
| 12 #include "sandbox/src/nt_internals.h" | 12 #include "sandbox/win/src/nt_internals.h" |
| 13 #include "sandbox/src/process_thread_interception.h" | 13 #include "sandbox/win/src/process_thread_interception.h" |
| 14 #include "sandbox/src/win_utils.h" | 14 #include "sandbox/win/src/win_utils.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 template<typename T> T RoundUpToWordSize(T v) { | 18 template<typename T> T RoundUpToWordSize(T v) { |
| 19 if (size_t mod = v % sizeof(size_t)) | 19 if (size_t mod = v % sizeof(size_t)) |
| 20 v += sizeof(size_t) - mod; | 20 v += sizeof(size_t) - mod; |
| 21 return v; | 21 return v; |
| 22 } | 22 } |
| 23 | 23 |
| 24 template<typename T> T* RoundUpToWordSize(T* v) { | 24 template<typename T> T* RoundUpToWordSize(T* v) { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 if (NT_SUCCESS(result) && name->Buffer && name->Length) | 193 if (NT_SUCCESS(result) && name->Buffer && name->Length) |
| 194 handle_name->assign(name->Buffer, name->Length / sizeof(wchar_t)); | 194 handle_name->assign(name->Buffer, name->Length / sizeof(wchar_t)); |
| 195 else | 195 else |
| 196 handle_name->clear(); | 196 handle_name->clear(); |
| 197 | 197 |
| 198 return NT_SUCCESS(result); | 198 return NT_SUCCESS(result); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace sandbox | 201 } // namespace sandbox |
| OLD | NEW |