Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: util/win/process_info.h

Issue 1412243005: win: Validate readability of memory ranges added to minidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « snapshot/win/thread_snapshot_win.cc ('k') | util/win/process_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 //! \brief Given a range to be read from the target process, returns a vector 132 //! \brief Given a range to be read from the target process, returns a vector
133 //! of ranges, representing the readable portions of the original range. 133 //! of ranges, representing the readable portions of the original range.
134 //! 134 //!
135 //! \param[in] range The range being identified. 135 //! \param[in] range The range being identified.
136 //! 136 //!
137 //! \return A vector of ranges corresponding to the portion of \a range that 137 //! \return A vector of ranges corresponding to the portion of \a range that
138 //! is readable based on the memory map. 138 //! is readable based on the memory map.
139 std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRanges( 139 std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRanges(
140 const CheckedRange<WinVMAddress, WinVMSize>& range) const; 140 const CheckedRange<WinVMAddress, WinVMSize>& range) const;
141 141
142 //! \brief Given a range in the target process, determines if the entire range
143 //! is readable.
144 //!
145 //! \param[in] range The range being inspected.
146 //!
147 //! \return `true` if the range is fully readable, otherwise `false` with a
148 //! message logged.
149 bool LoggingRangeIsFullyReadable(
150 const CheckedRange<WinVMAddress, WinVMSize>& range) const;
151
142 //! \brief Retrieves information about open handles in the target process. 152 //! \brief Retrieves information about open handles in the target process.
143 const std::vector<Handle>& Handles() const; 153 const std::vector<Handle>& Handles() const;
144 154
145 private: 155 private:
146 template <class Traits> 156 template <class Traits>
147 friend bool GetProcessBasicInformation(HANDLE process, 157 friend bool GetProcessBasicInformation(HANDLE process,
148 bool is_wow64, 158 bool is_wow64,
149 ProcessInfo* process_info, 159 ProcessInfo* process_info,
150 WinVMAddress* peb_address, 160 WinVMAddress* peb_address,
151 WinVMSize* peb_size); 161 WinVMSize* peb_size);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 //! 196 //!
187 //! This is a free function for testing, but prefer 197 //! This is a free function for testing, but prefer
188 //! ProcessInfo::GetReadableRanges(). 198 //! ProcessInfo::GetReadableRanges().
189 std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRangesOfMemoryMap( 199 std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRangesOfMemoryMap(
190 const CheckedRange<WinVMAddress, WinVMSize>& range, 200 const CheckedRange<WinVMAddress, WinVMSize>& range,
191 const std::vector<MEMORY_BASIC_INFORMATION64>& memory_info); 201 const std::vector<MEMORY_BASIC_INFORMATION64>& memory_info);
192 202
193 } // namespace crashpad 203 } // namespace crashpad
194 204
195 #endif // CRASHPAD_UTIL_WIN_PROCESS_INFO_H_ 205 #endif // CRASHPAD_UTIL_WIN_PROCESS_INFO_H_
OLDNEW
« no previous file with comments | « snapshot/win/thread_snapshot_win.cc ('k') | util/win/process_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698