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

Unified Diff: snapshot/win/process_reader_win.cc

Issue 1360863006: win: Add more memory regions to gathering of PEB (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@save-peb
Patch Set: . Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: snapshot/win/process_reader_win.cc
diff --git a/snapshot/win/process_reader_win.cc b/snapshot/win/process_reader_win.cc
index b8086afda7568c56bfb1307f2125be32ec453fe7..0588a6fb6afa5c44e5c38e41164c0482483c9fd7 100644
--- a/snapshot/win/process_reader_win.cc
+++ b/snapshot/win/process_reader_win.cc
@@ -231,6 +231,20 @@ bool ProcessReaderWin::ReadMemory(WinVMAddress at,
return true;
}
+WinVMSize ProcessReaderWin::ReadAvailableMemory(WinVMAddress at,
+ WinVMSize num_bytes,
+ void* into) const {
+ auto ranges = GetAccessibleRangesInMemoryMap(
+ at, num_bytes, process_info_.MemoryInformation());
+ // We only read up until the first unavailable block, so we only read from the
+ // first range.
+ if (ranges.empty())
+ return 0;
+ if (!ReadMemory(ranges.front().base(), ranges.front().size(), into))
+ return 0;
+ return ranges.front().size();
+}
+
bool ProcessReaderWin::StartTime(timeval* start_time) const {
FILETIME creation, exit, kernel, user;
if (!GetProcessTimes(process_, &creation, &exit, &kernel, &user)) {

Powered by Google App Engine
This is Rietveld 408576698