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
 
bool ReadMemory (WinVMAddress at, WinVMSize num_bytes, void *into) const
 Attempts to read num_bytes bytes from the target process starting at address at into into. More...
 
WinVMSize ReadAvailableMemory (WinVMAddress at, WinVMSize num_bytes, void *into) const
 Attempts to read num_bytes bytes from the target process starting at address at into into. If some of the specified range is not accessible, reads up to the first inaccessible byte. More...
 
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.

◆ ReadAvailableMemory()

WinVMSize crashpad::ProcessReaderWin::ReadAvailableMemory ( WinVMAddress  at,
WinVMSize  num_bytes,
void *  into 
) const

Attempts to read num_bytes bytes from the target process starting at address at into into. If some of the specified range is not accessible, reads up to the first inaccessible byte.

Returns
The actual number of bytes read.
See also
ReadMemory

◆ ReadMemory()

bool crashpad::ProcessReaderWin::ReadMemory ( WinVMAddress  at,
WinVMSize  num_bytes,
void *  into 
) const

Attempts to read num_bytes bytes from the target process starting at address at into into.

Returns
true if the entire region could be read, or false with an error logged.
See also
ReadAvailableMemory

◆ 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: