Struct windows_win::Process
source · pub struct Process { /* private fields */ }
Expand description
Windows process representation
Implementations§
source§impl Process
impl Process
sourcepub fn open(pid: u32, access_rights: u32) -> Result<Process>
pub fn open(pid: u32, access_rights: u32) -> Result<Process>
Creates handle to a new process by opening it through pid.
Note:
See information about access rights: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684880%28v=vs.85%29.aspx
Parameters:
pid
- Pid of the process.access_rights
- Bit mask that specifies desired access rights.
Return:
Ok
- Process struct.Err
- Error reason.
sourcepub fn into_inner(self) -> HANDLE
pub fn into_inner(self) -> HANDLE
Retrieves underlying handle and consumes self.
Basically you’re responsible to close handle now.
sourcepub fn read_memory(&self, base_addr: usize, storage: &mut [u8]) -> Result<()>
pub fn read_memory(&self, base_addr: usize, storage: &mut [u8]) -> Result<()>
Reads memory from process.
Parameters:
base_addr
- Address from where to start reading.storage
- Storage to hold memory. Itslen
determines amount of bytes to read.
sourcepub fn write_memory(&self, base_addr: usize, data: &[u8]) -> Result<()>
pub fn write_memory(&self, base_addr: usize, data: &[u8]) -> Result<()>
Writes into process memory.
Parameters:
base_addr
- Address from where to start writing.data
- Slice with write data.
Return:
Ok
- Success.Err
- Error reason.
Trait Implementations§
Auto Trait Implementations§
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