pub struct Process { /* private fields */ }Available on crate feature
process only.Expand description
A Windows process.
Implementations§
Source§impl Process
impl Process
Sourcepub fn current() -> Self
pub fn current() -> Self
Constructs a special handle that always points to the current process.
Sourcepub fn from_id<I>(id: I) -> Result<Self>
pub fn from_id<I>(id: I) -> Result<Self>
Tries to acquire a process handle from an ID.
This may fail due to insufficient access rights.
pub fn get_id(&self) -> ProcessId
Sourcepub fn begin_background_mode() -> Result<()>
pub fn begin_background_mode() -> Result<()>
Sets the current process to background processing mode.
This will also lower the I/O priority of the process, which will lower the impact of heavy disk I/O on other processes.
Sourcepub fn end_background_mode() -> Result<()>
pub fn end_background_mode() -> Result<()>
Ends background processing mode for the current process.
Sourcepub fn set_priority(&self, priority: ProcessPriority) -> Result<()>
pub fn set_priority(&self, priority: ProcessPriority) -> Result<()>
Sets the priority of the process.
§Examples
use winapi_easy::process::{Process, ProcessPriority};
Process::current().set_priority(ProcessPriority::Normal)?;
Sourcepub fn get_io_priority(&self) -> Result<Option<IoPriority>>
pub fn get_io_priority(&self) -> Result<Option<IoPriority>>
Returns the I/O priority of the process.
Will return None if it is an unknown value.
pub fn set_io_priority(&self, io_priority: IoPriority) -> Result<()>
pub fn wait_for_initialization(&self) -> Result<()>
Sourcepub unsafe fn create_remote_thread(
&self,
start_address: *const c_void,
call_param0: Option<*const c_void>,
) -> Result<Thread>
pub unsafe fn create_remote_thread( &self, start_address: *const c_void, call_param0: Option<*const c_void>, ) -> Result<Thread>
Creates a thread in another process.
§Safety
Requires start_address to be a function pointer valid in the remote process
and ABI-compatible with the signature: unsafe extern "system" fn(*mut std::ffi::c_void) -> u32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Process
impl RefUnwindSafe for Process
impl !Send for Process
impl !Sync for Process
impl Unpin for Process
impl UnwindSafe for Process
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more