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

Unified Diff: util/win/process_info.cc

Issue 1370063005: MEM_RESERVE regions are not accessible by ReadProcessMemory() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
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
« no previous file with comments | « no previous file | util/win/process_info_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info.cc
diff --git a/util/win/process_info.cc b/util/win/process_info.cc
index a0364cb59b6e58d3a8fcff89625eb1ac72837318..bfc83a60936f18f6a4784421692bc99a7f41e34a 100644
--- a/util/win/process_info.cc
+++ b/util/win/process_info.cc
@@ -107,11 +107,10 @@ bool ReadStruct(HANDLE process, WinVMAddress at, T* into) {
return true;
}
-bool RegionIsInaccessible(const ProcessInfo::MemoryInfo& memory_info) {
- return memory_info.state == MEM_FREE ||
- (memory_info.state == MEM_COMMIT &&
- ((memory_info.protect & PAGE_NOACCESS) ||
- (memory_info.protect & PAGE_GUARD)));
+bool RegionIsAccessible(const ProcessInfo::MemoryInfo& memory_info) {
+ return memory_info.state == MEM_COMMIT &&
+ (memory_info.protect & PAGE_NOACCESS) == 0 &&
+ (memory_info.protect & PAGE_GUARD) == 0;
}
} // namespace
@@ -468,7 +467,7 @@ std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRangesOfMemoryMap(
overlapping.erase(std::remove_if(overlapping.begin(),
overlapping.end(),
[](const ProcessInfo::MemoryInfo& mi) {
- return RegionIsInaccessible(mi);
+ return !RegionIsAccessible(mi);
}),
overlapping.end());
if (overlapping.empty())
« no previous file with comments | « no previous file | util/win/process_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698