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

Unified Diff: util/win/process_info.h

Issue 1369833002: win: Gather memory information (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@save-peb-stuff
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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info.h
diff --git a/util/win/process_info.h b/util/win/process_info.h
index ed07ab09f6b8ef27a51c6c456cdd7f40c2a285d1..5af28bd762bddabcc62f2f8be5e7cb88150f7ff0 100644
--- a/util/win/process_info.h
+++ b/util/win/process_info.h
@@ -49,6 +49,40 @@ class ProcessInfo {
time_t timestamp;
};
+ // \brief Contains information about a range of pages in the virtual address
+ // space of a process.
+ struct MemoryInfo {
+ explicit MemoryInfo(const MEMORY_BASIC_INFORMATION& mbi);
+ ~MemoryInfo();
+
+ //! \brief The base address of the region of pages.
+ WinVMAddress base_address;
+
+ //! \brief The size of the region beginning at base_address in bytes.
+ WinVMSize region_size;
+
+ //! \brief The base address of a range of pages that was allocated by
+ //! `VirtualAlloc()`. The page pointed to base_address is within this
+ //! range of pages.
+ WinVMAddress allocation_base;
+
+ //! \brief The state of the pages, one of `MEM_COMMIT`, `MEM_FREE`, or
+ //! `MEM_RESERVE`.
+ uint32_t state;
+
+ //! \brief The memory protection option when this page was originally
+ //! allocated. This will be `PAGE_EXECUTE`, `PAGE_EXECUTE_READ`, etc.
+ uint32_t allocation_protect;
+
+ //! \brief The current memoryprotection state. This will be `PAGE_EXECUTE`,
+ //! `PAGE_EXECUTE_READ`, etc.
+ uint32_t protect;
+
+ //! \brief The type of the pages. This will be one of `MEM_IMAGE`,
+ //! `MEM_MAPPED`, or `MEM_PRIVATE`.
+ uint32_t type;
+ };
+
ProcessInfo();
~ProcessInfo();
@@ -92,6 +126,9 @@ class ProcessInfo {
//! first element.
bool Modules(std::vector<Module>* modules) const;
+ //! \brief Retrieves information about all pages mapped into the process.
+ const std::vector<MemoryInfo>& MemoryInformation() const;
+
private:
template <class Traits>
friend bool GetProcessBasicInformation(HANDLE process,
@@ -104,12 +141,15 @@ class ProcessInfo {
WinVMAddress peb_address_vmaddr,
ProcessInfo* process_info);
+ friend bool ReadMemoryInfo(HANDLE process, ProcessInfo* process_info);
+
pid_t process_id_;
pid_t inherited_from_process_id_;
std::wstring command_line_;
WinVMAddress peb_address_;
WinVMSize peb_size_;
std::vector<Module> modules_;
+ std::vector<MemoryInfo> memory_info_;
bool is_64_bit_;
bool is_wow64_;
InitializationStateDcheck initialized_;
« no previous file with comments | « no previous file | util/win/process_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698