KasperskyOS Community Edition 1.1
Contents
Contents
KnVmProtect()
This function is declared in the coresrv/vmm/vmm_api.h
file.
Retcode KnVmProtect(void *addr, rtl_size_t size, int newFlags);
Modifies the protection attributes of reserved or committed memory pages.
Parameters:
addr
is the page-aligned base virtual address of the memory area.size
is the size of the memory area in bytes (must be a multiple of the page size).newFlags
refers to new protection attributes.
If the protection attributes are successfully changed, the function returns rcOk.
Permissible combinations of memory protection attributes:
- VMM_FLAG_READ allows reading page contents.
- VMM_FLAG_READ | VMM_FLAG_WRITE allows reading and modifying page contents.
- VMM_FLAG_READ | VMM_FLAG_EXECUTE allows reading and executing page contents.
- VMM_FLAG_RWX_MASK or VMM_FLAG_READ | VMM_FLAG_WRITE | VMM_FLAG_EXECUTE refers to full access to page contents (these entries are equivalent).