OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef SANDBOX_SRC_SANDBOX_NT_UTIL_H_ | 5 #ifndef SANDBOX_SRC_SANDBOX_NT_UTIL_H_ |
6 #define SANDBOX_SRC_SANDBOX_NT_UTIL_H_ | 6 #define SANDBOX_SRC_SANDBOX_NT_UTIL_H_ |
7 | 7 |
8 #include <intrin.h> | 8 #include <intrin.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // write) | 96 // write) |
97 bool ValidParameter(void* buffer, size_t size, RequiredAccess intent); | 97 bool ValidParameter(void* buffer, size_t size, RequiredAccess intent); |
98 | 98 |
99 // Copies data from a user buffer to our buffer. Returns the operation status. | 99 // Copies data from a user buffer to our buffer. Returns the operation status. |
100 NTSTATUS CopyData(void* destination, const void* source, size_t bytes); | 100 NTSTATUS CopyData(void* destination, const void* source, size_t bytes); |
101 | 101 |
102 // Copies the name from an object attributes. | 102 // Copies the name from an object attributes. |
103 NTSTATUS AllocAndCopyName(const OBJECT_ATTRIBUTES* in_object, | 103 NTSTATUS AllocAndCopyName(const OBJECT_ATTRIBUTES* in_object, |
104 wchar_t** out_name, uint32* attributes, HANDLE* root); | 104 wchar_t** out_name, uint32* attributes, HANDLE* root); |
105 | 105 |
| 106 // Determine full path name from object root and path. |
| 107 NTSTATUS AllocAndGetFullPath(HANDLE root, |
| 108 wchar_t* path, |
| 109 wchar_t** full_path); |
| 110 |
106 // Initializes our ntdll level heap | 111 // Initializes our ntdll level heap |
107 bool InitHeap(); | 112 bool InitHeap(); |
108 | 113 |
109 // Returns true if the provided handle refers to the current process. | 114 // Returns true if the provided handle refers to the current process. |
110 bool IsSameProcess(HANDLE process); | 115 bool IsSameProcess(HANDLE process); |
111 | 116 |
112 enum MappedModuleFlags { | 117 enum MappedModuleFlags { |
113 MODULE_IS_PE_IMAGE = 1, // Module is an executable. | 118 MODULE_IS_PE_IMAGE = 1, // Module is an executable. |
114 MODULE_HAS_ENTRY_POINT = 2, // Execution entry point found. | 119 MODULE_HAS_ENTRY_POINT = 2, // Execution entry point found. |
115 MODULE_HAS_CODE = 4 // Non zero size of executable sections. | 120 MODULE_HAS_CODE = 4 // Non zero size of executable sections. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 182 |
178 // Returns true if the file_rename_information structure is supported by our | 183 // Returns true if the file_rename_information structure is supported by our |
179 // rename handler. | 184 // rename handler. |
180 bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, | 185 bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, |
181 uint32 file_info_class); | 186 uint32 file_info_class); |
182 | 187 |
183 } // namespace sandbox | 188 } // namespace sandbox |
184 | 189 |
185 | 190 |
186 #endif // SANDBOX_SRC_SANDBOX_NT_UTIL_H__ | 191 #endif // SANDBOX_SRC_SANDBOX_NT_UTIL_H__ |
OLD | NEW |