| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "sandbox/src/nt_internals.h" | 9 #include "sandbox/src/nt_internals.h" |
| 10 #include "sandbox/src/sandbox_nt_types.h" | 10 #include "sandbox/src/sandbox_nt_types.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // operator delete(name, NT_ALLOC); | 111 // operator delete(name, NT_ALLOC); |
| 112 UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags); | 112 UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags); |
| 113 | 113 |
| 114 // Returns the full path and filename for a given dll. | 114 // Returns the full path and filename for a given dll. |
| 115 // May return NULL if the provided address is not backed by a named section, or | 115 // May return NULL if the provided address is not backed by a named section, or |
| 116 // if the current OS version doesn't support the call. The returned buffer must | 116 // if the current OS version doesn't support the call. The returned buffer must |
| 117 // be freed with a placement delete (see GetImageNameFromModule example). | 117 // be freed with a placement delete (see GetImageNameFromModule example). |
| 118 UNICODE_STRING* GetBackingFilePath(PVOID address); | 118 UNICODE_STRING* GetBackingFilePath(PVOID address); |
| 119 | 119 |
| 120 // Returns the last component of a path that contains the module name. | 120 // Returns the last component of a path that contains the module name. |
| 121 // It will return NULL if the path is not a full path or if the path ends | 121 // It will return NULL if the path ends with the path separator. The returned |
| 122 // with the path separator. The returned buffer must be freed with a placement | 122 // buffer must be freed with a placement delete (see GetImageNameFromModule |
| 123 // delete (see GetImageNameFromModule example). | 123 // example). |
| 124 UNICODE_STRING* ExtractModuleName(const UNICODE_STRING* module_path); | 124 UNICODE_STRING* ExtractModuleName(const UNICODE_STRING* module_path); |
| 125 | 125 |
| 126 // Returns true if the parameters correspond to a dll mapped as code. | 126 // Returns true if the parameters correspond to a dll mapped as code. |
| 127 bool IsValidImageSection(HANDLE section, PVOID *base, PLARGE_INTEGER offset, | 127 bool IsValidImageSection(HANDLE section, PVOID *base, PLARGE_INTEGER offset, |
| 128 PULONG view_size); | 128 PULONG view_size); |
| 129 | 129 |
| 130 // Converts an ansi string to an UNICODE_STRING. | 130 // Converts an ansi string to an UNICODE_STRING. |
| 131 UNICODE_STRING* AnsiToUnicode(const char* string); | 131 UNICODE_STRING* AnsiToUnicode(const char* string); |
| 132 | 132 |
| 133 // Provides a simple way to temporarily change the protection of a memory page. | 133 // Provides a simple way to temporarily change the protection of a memory page. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 157 | 157 |
| 158 // Returns true if the file_rename_information structure is supported by our | 158 // Returns true if the file_rename_information structure is supported by our |
| 159 // rename handler. | 159 // rename handler. |
| 160 bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, | 160 bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, |
| 161 uint32 file_info_class); | 161 uint32 file_info_class); |
| 162 | 162 |
| 163 } // namespace sandbox | 163 } // namespace sandbox |
| 164 | 164 |
| 165 | 165 |
| 166 #endif // SANDBOX_SRC_SANDBOX_NT_UTIL_H__ | 166 #endif // SANDBOX_SRC_SANDBOX_NT_UTIL_H__ |
| OLD | NEW |