Index: util/win/process_info.h |
diff --git a/util/win/process_info.h b/util/win/process_info.h |
index dac7b7c920edad1d58ed0112fff48230174f921f..74d5ff6fe5259fa018da1c786f9ff03bf3cfa8dc 100644 |
--- a/util/win/process_info.h |
+++ b/util/win/process_info.h |
@@ -50,6 +50,40 @@ 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. |
+ //! |
+ //! See https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203 on |
+ //! 32 bit being the correct size for HANDLEs for proceses, even on Windows |
+ //! x64. |
+ uint32_t handle; |
+ |
+ //! \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. |
+ //! |
+ //! See |
+ //! http://blogs.msdn.com/b/openspecification/archive/2010/04/01/about-the-access-mask-structure.aspx |
+ //! for more information. |
+ 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 +140,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_; } |
Mark Mentovai
2015/10/15 05:25:17
All of the other getters aren’t inline so they can
scottmg
2015/10/15 21:38:45
Done.
|
+ |
private: |
template <class Traits> |
friend bool GetProcessBasicInformation(HANDLE process, |
@@ -122,6 +159,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 +169,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_; |