track parent PID and thread count in ProcessInfo
This commit is contained in:
@@ -3,8 +3,10 @@ use std::fmt;
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct ProcessInfo {
|
pub struct ProcessInfo {
|
||||||
pub pid: u32,
|
pub pid: u32,
|
||||||
|
pub ppid: u32,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub path: Option<String>,
|
pub path: Option<String>,
|
||||||
|
pub thread_count: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for ProcessInfo {
|
impl fmt::Display for ProcessInfo {
|
||||||
@@ -47,8 +49,10 @@ mod platform {
|
|||||||
|
|
||||||
processes.push(ProcessInfo {
|
processes.push(ProcessInfo {
|
||||||
pid: entry.th32ProcessID,
|
pid: entry.th32ProcessID,
|
||||||
|
ppid: entry.th32ParentProcessID,
|
||||||
name,
|
name,
|
||||||
path: None,
|
path: None,
|
||||||
|
thread_count: entry.cntThreads,
|
||||||
});
|
});
|
||||||
|
|
||||||
if Process32NextW(snapshot, &mut entry).is_err() {
|
if Process32NextW(snapshot, &mut entry).is_err() {
|
||||||
|
|||||||
Reference in New Issue
Block a user