Struct faithe::thread::OwnedThread
source · [−]pub struct OwnedThread(_);
Expand description
Represents a handle to a thread.
Implementations
sourceimpl OwnedThread
impl OwnedThread
sourcepub fn open(
thread_id: u32,
inherit_handle: bool,
desired_access: THREAD_ACCESS_RIGHTS
) -> Result<Self, FaitheError>
pub fn open(
thread_id: u32,
inherit_handle: bool,
desired_access: THREAD_ACCESS_RIGHTS
) -> Result<Self, FaitheError>
Tries to open thread by its id.
sourcepub fn into_handle(self) -> HANDLE
pub fn into_handle(self) -> HANDLE
Converts OwnedThread
into inner HANDLE
.
sourcepub fn start_address(&self) -> Result<usize, FaitheError>
pub fn start_address(&self) -> Result<usize, FaitheError>
Returns the start address of the thread
sourcepub fn suspend(&self) -> Result<u32, FaitheError>
pub fn suspend(&self) -> Result<u32, FaitheError>
Tries to suspend the thread. On success returns the previous suspend count.
sourcepub fn resume(&self) -> Result<u32, FaitheError>
pub fn resume(&self) -> Result<u32, FaitheError>
Tries to resume the thread. On success returns the previous suspend count.
sourcepub fn get_context(&self) -> Result<CONTEXT, FaitheError>
pub fn get_context(&self) -> Result<CONTEXT, FaitheError>
Returns the context of the thread. For more info see microsoft documentation
sourcepub fn set_context(&self, ctx: &CONTEXT) -> Result<(), FaitheError>
pub fn set_context(&self, ctx: &CONTEXT) -> Result<(), FaitheError>
Sets the context for the thread. For more info see microsoft documentation
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for OwnedThread
impl Send for OwnedThread
impl Sync for OwnedThread
impl Unpin for OwnedThread
impl UnwindSafe for OwnedThread
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more