pub fn protect(addr: usize, bytes: usize, prot: Protection) -> Result<(), io::Error> {
    unsafe {
        if VirtualProtect(addr as *mut _, bytes, self::prot(prot), ptr::null_mut()) == 0 {
            Err(io::Error::last_os_error())
        } else {
            Ok(())
        }
    }
}
/// Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using ` alloc ` .
pub fn protect(addr: usize, bytes: usize, prot: Protection) -> Result<(), io::Error> {
    unsafe {
        if VirtualProtect(addr as *mut _, bytes, self::prot(prot), ptr::null_mut()) == 0 {
            Err(io::Error::last_os_error())
        } else {
            Ok(())
        }
    }
}
pub fn protect ( addr : usize , bytes : usize , prot : Protection ) -> Result < ( ) , io :: Error > { unsafe { if VirtualProtect ( addr as * mut _ , bytes , self :: prot ( prot ) , ptr :: null_mut ( ) ) == 0 { Err ( io :: Error :: last_os_error ( ) ) } else { Ok ( ( ) ) } } }
Changes the protection of a memory region allocated using `alloc`.
Changes the protection of a memory region allocated using ` alloc ` .
addr
usize
bytes
usize
prot
Protection
addr
usize
bytes
usize
prot
Protection