Index: util/win/process_info.h |
diff --git a/util/win/process_info.h b/util/win/process_info.h |
index dac7b7c920edad1d58ed0112fff48230174f921f..7f333ff2a4d53aba8110aeee2c3ecee14a94e6ae 100644 |
--- a/util/win/process_info.h |
+++ b/util/win/process_info.h |
@@ -50,6 +50,33 @@ class ProcessInfo { |
time_t timestamp; |
}; |
+ struct Handle { |
+ Handle(); |
+ ~Handle(); |
+ |
+ //! \brief A string representation of the handle's type. |
+ std::wstring type_name; |
+ |
+ //! \brief The handle's value. |
+ uint32_t handle; |
Mark Mentovai
2015/10/14 22:49:55
This is at least as good a place for the comment a
scottmg
2015/10/15 00:17:42
Done.
|
+ |
+ //! \brief The attributes for the handle, e.g. `OBJ_INHERIT`, |
+ //! `OBJ_CASE_INSENSITIVE`, etc. |
+ uint32_t attributes; |
+ |
+ //! \brief The ACCESS_MASK for the handle in this process. Ref: |
Mark Mentovai
2015/10/14 22:49:55
`ACCESS_MASK`
scottmg
2015/10/15 00:17:42
Done.
|
+ //! http://blogs.msdn.com/b/openspecification/archive/2010/04/01/about-the-access-mask-structure.aspx |
Mark Mentovai
2015/10/14 22:49:55
The URL reference shouldn’t be part of the \brief.
scottmg
2015/10/15 00:17:42
Done.
|
+ uint32_t granted_access; |
+ |
+ //! \brief The number of kernel references to the object that this handle |
+ //! refers to. |
+ uint32_t pointer_count; |
+ |
+ //! \brief The number of open handles to the object that this handle refers |
+ //! to. |
+ uint32_t handle_count; |
+ }; |
+ |
ProcessInfo(); |
~ProcessInfo(); |
@@ -106,6 +133,9 @@ class ProcessInfo { |
std::vector<CheckedRange<WinVMAddress, WinVMSize>> GetReadableRanges( |
const CheckedRange<WinVMAddress, WinVMSize>& range) const; |
+ //! \brief Retrieves information about open handles in the target process. |
+ const std::vector<Handle>& Handles() const { return handles_; } |
+ |
private: |
template <class Traits> |
friend bool GetProcessBasicInformation(HANDLE process, |
@@ -122,6 +152,9 @@ class ProcessInfo { |
bool is_64_bit, |
ProcessInfo* process_info); |
+ template <class Traits> |
+ std::vector<Handle> BuildHandleVector(HANDLE process) const; |
+ |
pid_t process_id_; |
pid_t inherited_from_process_id_; |
std::wstring command_line_; |
@@ -129,6 +162,7 @@ class ProcessInfo { |
WinVMSize peb_size_; |
std::vector<Module> modules_; |
std::vector<MEMORY_BASIC_INFORMATION64> memory_info_; |
+ std::vector<Handle> handles_; |
bool is_64_bit_; |
bool is_wow64_; |
InitializationStateDcheck initialized_; |