mm

mm —

Synopsis




gint        captive_flProtect_to_mmap_prot  (ULONG flProtect);
gboolean    captive_mmap_map_new            (gconstpointer addr,
                                             size_t len,
                                             int mmap_prot);
gint        captive_mmap_map_get            (gconstpointer addr);
gboolean    captive_mmap_map_set            (gconstpointer addr,
                                             int mmap_prot);

Description

Details

captive_flProtect_to_mmap_prot ()

gint        captive_flProtect_to_mmap_prot  (ULONG flProtect);

Map reactos flProtect to mprotect(2)-compatible "prot" argument.

flProtect : reactos compatible constant such as PAGE_READWRITE.
Returns : mmap(2) compatible prot argument.

captive_mmap_map_new ()

gboolean    captive_mmap_map_new            (gconstpointer addr,
                                             size_t len,
                                             int mmap_prot);

Initialize the protection map for the specified memory block. Any existing protections in the specified block are forbidden.

This function does not do any mprotect(2) style, it just stores the settings for the later OR operations by MmSetPageProtect(). Caller is responsibel to set the same protections as the given mmap_prot.

addr : PAGE_SIZE aligned address of memory block. NULL value is forbidden.
len : PAGE_SIZE aligned length of memory block. Value 0 is permitted. Value -1 is forbidden.
mmap_prot : Protections for the memory block as specified by prot of mprotect(2).
Returns : TRUE if the protection storage was successful.

captive_mmap_map_get ()

gint        captive_mmap_map_get            (gconstpointer addr);

Query the protection settings at addr address. The given addr block of PAGE_SIZE must be already initialized by captive_mmap_map_new().

addr : PAGE_SIZE aligned address of memory block. NULL value is forbidden.
Returns : Protections of the page as specified by prot of mprotect(2) if successful. Value -1 if failed.

captive_mmap_map_set ()

gboolean    captive_mmap_map_set            (gconstpointer addr,
                                             int mmap_prot);

Set the protection settings at addr address. The given addr block of PAGE_SIZE must be already initialized by captive_mmap_map_new().

addr : PAGE_SIZE aligned address of memory block. NULL value is forbidden.
mmap_prot : Protections for the memory block as specified by prot of mprotect(2).
Returns : TRUE if the protections were successfuly set.