pub fn sys_process_read_memory(
        &self,
        handle_value: HandleValue,
        vaddr: usize,
        mut buffer: UserOutPtr<u8>,
        buffer_size: usize,
        mut actual: UserOutPtr<usize>,
    ) -> ZxResult {
        if buffer.is_null() || buffer_size == 0 || buffer_size > MAX_BLOCK {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let process =
            proc.get_object_with_rights::<Process>(handle_value, Rights::READ | Rights::WRITE)?;
        let mut data = vec![0u8; buffer_size];
        let len = process.vmar().read_memory(vaddr, &mut data)?;
        buffer.write_array(&data[..len])?;
        actual.write(len)?;
        Ok(())
    }
/// Read from the given process's address space.
///
/// > This function will eventually be replaced with something vmo-centric.
Read from the given process's address space.
> This function will eventually be replaced with something vmo-centric.
Read from the given process ' s address space . > This function will eventually be replaced with something vmo - centric .
pub fn sys_process_read_memory(
        &self,
        handle_value: HandleValue,
        vaddr: usize,
        mut buffer: UserOutPtr<u8>,
        buffer_size: usize,
        mut actual: UserOutPtr<usize>,
    ) -> ZxResult {
        if buffer.is_null() || buffer_size == 0 || buffer_size > MAX_BLOCK {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let process =
            proc.get_object_with_rights::<Process>(handle_value, Rights::READ | Rights::WRITE)?;
        let mut data = vec![0u8; buffer_size];
        let len = process.vmar().read_memory(vaddr, &mut data)?;
        buffer.write_array(&data[..len])?;
        actual.write(len)?;
        Ok(())
    }
pub fn sys_process_read_memory ( & self , handle_value : HandleValue , vaddr : usize , mut buffer : UserOutPtr < u8 > , buffer_size : usize , mut actual : UserOutPtr < usize > , ) -> ZxResult { if buffer . is_null ( ) || buffer_size == 0 || buffer_size > MAX_BLOCK { return Err ( ZxError :: INVALID_ARGS ) ; } let proc = self . thread . proc ( ) ; let process = proc . get_object_with_rights :: < Process > ( handle_value , Rights :: READ | Rights :: WRITE ) ? ; let mut data = vec ! [ 0u8 buffer_size ] ; let len = process . vmar ( ) . read_memory ( vaddr , & mut data ) ? ; buffer . write_array ( & data [ .. len ] ) ? ; actual . write ( len ) ? ; Ok ( ( ) ) }
Read from the given process's address space.
Read from the given process ' s address space .
&self
handle_value
HandleValue
vaddr
usize
buffer
UserOutPtr<u8>
buffer_size
usize
actual
UserOutPtr<usize>
&self
handle_value
HandleValue
vaddr
usize
buffer
UserOutPtr<u8>
buffer_size
usize
actual
UserOutPtr<usize>