Crashpad
Classes | Public Member Functions | List of all members
crashpad::ProcessReaderWin Class Reference

Accesses information about another process, identified by a HANDLE. More...

#include "snapshot/win/process_reader_win.h"

Classes

struct  Thread
 Contains information about a thread that belongs to a process. More...
 

Public Member Functions

bool Initialize (HANDLE process, ProcessSuspensionState suspension_state)
 Initializes this object. This method must be called before any other. More...
 
bool Is64Bit () const
 
const ProcessMemoryWinMemory () const
 Return a memory reader for the target process.
 
bool StartTime (timeval *start_time) const
 Determines the target process' start time. More...
 
bool CPUTimes (timeval *user_time, timeval *system_time) const
 Determines the target process' execution time. More...
 
const std::vector< Thread > & Threads ()
 
const std::vector< ProcessInfo::Module > & Modules ()
 
const ProcessInfoGetProcessInfo () const
 
void DecrementThreadSuspendCounts (uint64_t except_thread_id)
 Decrements the thread suspend counts for all thread ids other than except_thread_id. More...
 

Detailed Description

Accesses information about another process, identified by a HANDLE.

Member Function Documentation

◆ CPUTimes()

bool crashpad::ProcessReaderWin::CPUTimes ( timeval *  user_time,
timeval *  system_time 
) const

Determines the target process' execution time.

Parameters
[out]user_timeThe amount of time the process has executed code in user mode.
[out]system_timeThe amount of time the process has executed code in kernel mode.
Returns
true on success, false on failure, with a warning logged.

◆ DecrementThreadSuspendCounts()

void crashpad::ProcessReaderWin::DecrementThreadSuspendCounts ( uint64_t  except_thread_id)

Decrements the thread suspend counts for all thread ids other than except_thread_id.

Used to adjust the thread suspend count to correspond to the actual values for the process before Crashpad got involved.

◆ GetProcessInfo()

const ProcessInfo & crashpad::ProcessReaderWin::GetProcessInfo ( ) const
Returns
A ProcessInfo object for the process being read.

◆ Initialize()

bool crashpad::ProcessReaderWin::Initialize ( HANDLE  process,
ProcessSuspensionState  suspension_state 
)

Initializes this object. This method must be called before any other.

Parameters
[in]processProcess handle, must have PROCESS_QUERY_INFORMATION, PROCESS_VM_READ, and PROCESS_DUP_HANDLE access.
[in]suspension_stateWhether process has already been suspended by the caller. Typically, this will be ProcessSuspensionState::kSuspended, except for testing uses and where the reader is reading itself.
Returns
true on success, indicating that this object will respond validly to further method calls. false on failure. On failure, no further method calls should be made.
See also
ScopedProcessSuspend

◆ Is64Bit()

bool crashpad::ProcessReaderWin::Is64Bit ( ) const
inline
Returns
true if the target task is a 64-bit process.

◆ Modules()

const std::vector< ProcessInfo::Module > & crashpad::ProcessReaderWin::Modules ( )
Returns
The modules loaded in the process. The first element (at index 0) corresponds to the main executable.

◆ StartTime()

bool crashpad::ProcessReaderWin::StartTime ( timeval *  start_time) const

Determines the target process' start time.

Parameters
[out]start_timeThe time that the process started.
Returns
true on success, false on failure, with a warning logged.

◆ Threads()

const std::vector< ProcessReaderWin::Thread > & crashpad::ProcessReaderWin::Threads ( )
Returns
The threads that are in the process. The first element (at index 0) corresponds to the main thread.

The documentation for this class was generated from the following files: