Expand description
tasklist
tasklist is a crate let you easily get tasklist and process information on windows.
it based on windows-rs crate.
what information you can get
- Process name,pid,parrentID,theradsID.
- Process start_time,exit_time,and CPU_time(including kernel time and user time).
- Process path and commandline params.
- Process SID and Domain/User.
- Process IO infomation , including all of
IO_COUNTERSmember. - Process memory information , including all of
PROCESS_MEMORY_COUNTERSmember. - Process handles information , use
GetProcessHandleCountApi. - Process file infomation , use
GetFileVersionInfoExWApi. - Pterate over all processes
remember some infomation need higher privilege in some specific windows versions
example
use tasklist;
fn main(){
unsafe{
let tl = tasklist::Tasklist::new();
for i in tl{
println!("{} {} {}",i.get_pid(),i.get_pname(),i.get_user());
}
}
}Modules
Structs
the process’s IO counter struct
process’s memory counter struct . can easily get memory infomation of a process.
the process struct .
this struct is Process Iterator.
Functions
enbale the debug privilege for your program , it return a bool to show if it success.
return the first process id by the name you gave , it return the Option<u32> , u32 is the process id.
find the process id by the name you gave , it return a Vec<U32> , if the process is not exist , it will return a empty Vec<u32>
just like the name , this function will return a Option<String> by the id you gave, String is the name of process.