Struct winproc::Process [−][src]
pub struct Process { /* fields omitted */ }
A handle to a running process.
Methods
impl Process
[src]
impl Process
pub fn from_id(id: u32) -> WinResult<Process>
[src]
pub fn from_id(id: u32) -> WinResult<Process>
Creates a process handle from a PID. Requests all access permissions.
pub fn from_id_with_access(id: u32, access: Access) -> WinResult<Process>
[src]
pub fn from_id_with_access(id: u32, access: Access) -> WinResult<Process>
Creates a process handle from a PID. Requests the specified access permissions.
pub fn from_name(name: &str) -> WinResult<Process>
[src]
pub fn from_name(name: &str) -> WinResult<Process>
Creates a process handle from a name. Requests all access.
pub fn from_name_with_access(name: &str, access: Access) -> WinResult<Process>
[src]
pub fn from_name_with_access(name: &str, access: Access) -> WinResult<Process>
Creates a process handle from a name.
pub fn from_handle(handle: Handle) -> Process
[src]
pub fn from_handle(handle: Handle) -> Process
Creates a process handle from a handle.
pub fn current() -> Process
[src]
pub fn current() -> Process
Returns a handle to the current process.
pub fn handle(&self) -> &Handle
[src]
pub fn handle(&self) -> &Handle
Returns a reference to the inner handle.
pub fn all(
) -> WinResult<impl Iterator<Item = Process>>
[src]
pub fn all(
) -> WinResult<impl Iterator<Item = Process>>
Enumerates all running processes. Requests all access.
pub fn all_with_access(
access: Access
) -> WinResult<impl Iterator<Item = Process>>
[src]
pub fn all_with_access(
access: Access
) -> WinResult<impl Iterator<Item = Process>>
Enumerates all running processes.
pub fn id(&self) -> u32
[src]
pub fn id(&self) -> u32
Returns the process's id.
pub fn running(&self) -> bool
[src]
pub fn running(&self) -> bool
Returns true if the process is running.
pub fn path(&self) -> WinResult<PathBuf>
[src]
pub fn path(&self) -> WinResult<PathBuf>
Returns the path of the executable of the process.
pub fn name(&self) -> WinResult<String>
[src]
pub fn name(&self) -> WinResult<String>
Returns the unqualified name of the executable of the process.
pub fn affinity_mask(&self) -> WinResult<usize>
[src]
pub fn affinity_mask(&self) -> WinResult<usize>
Returns the affinity mask of the process.
pub fn set_affinity_mask(&mut self, mask: u32) -> WinResult<()>
[src]
pub fn set_affinity_mask(&mut self, mask: u32) -> WinResult<()>
Sets the affinity mask of the thread. On success, returns the previous affinity mask.
A process affinity mask is a bit vector in which each bit represents a logical processor that a process is allowed to run on.
Setting an affinity mask for a process or thread can result in threads receiving less processor time, as the system is restricted from running the threads on certain processors. In most cases, it is better to let the system select an available processor.
If the new process affinity mask does not specify the processor that is currently running the process, the process is rescheduled on one of the allowable processors.
pub fn threads<'a>(
&'a self
) -> WinResult<impl Iterator<Item = Thread> + 'a>
[src]
pub fn threads<'a>(
&'a self
) -> WinResult<impl Iterator<Item = Thread> + 'a>
Returns an iterator over the threads of the process.
pub fn thread_ids<'a>(
&'a self
) -> WinResult<impl Iterator<Item = u32> + 'a>
[src]
pub fn thread_ids<'a>(
&'a self
) -> WinResult<impl Iterator<Item = u32> + 'a>
Returns an iterator over the ids of threads of the process.
pub fn module<'a, N: AsRef<OsStr>>(&'a self, name: N) -> WinResult<Module<'a>>
[src]
pub fn module<'a, N: AsRef<OsStr>>(&'a self, name: N) -> WinResult<Module<'a>>
Returns the loaded module with the specified name/path.
pub fn module_list<'a>(&'a self) -> WinResult<Vec<Module<'a>>>
[src]
pub fn module_list<'a>(&'a self) -> WinResult<Vec<Module<'a>>>
Returns a list of the modules of the process.
pub fn module_entries<'a>(
&'a self
) -> WinResult<impl Iterator<Item = ModuleEntry> + 'a>
[src]
pub fn module_entries<'a>(
&'a self
) -> WinResult<impl Iterator<Item = ModuleEntry> + 'a>
Returns an iterator over the modules of the process.
Trait Implementations
impl Debug for Process
[src]
impl Debug for Process
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl AsRawHandle for Process
[src]
impl AsRawHandle for Process
fn as_raw_handle(&self) -> HANDLE
[src]
fn as_raw_handle(&self) -> HANDLE
Extracts the raw handle, without taking any ownership.
impl Deref for Process
[src]
impl Deref for Process
type Target = HANDLE
The resulting type after dereferencing.
fn deref(&self) -> &HANDLE
[src]
fn deref(&self) -> &HANDLE
Dereferences the value.
impl FromRawHandle for Process
[src]
impl FromRawHandle for Process
unsafe fn from_raw_handle(handle: HANDLE) -> Process
[src]
unsafe fn from_raw_handle(handle: HANDLE) -> Process
Constructs a new I/O object from the specified raw handle. Read more
impl IntoRawHandle for Process
[src]
impl IntoRawHandle for Process
fn into_raw_handle(self) -> HANDLE
[src]
fn into_raw_handle(self) -> HANDLE
Consumes this object, returning the raw underlying handle. Read more