Guardmemory
int Guardmemory(ulong base,ulong size,int guard);
Applies
or removes one-shot memory breakpoint (guarding page) to the specified
memory range. When application accesses guarded page, Windows raises
EXCEPTION_GUARD_PAGE and removes breakpoint from the accessed memory
page. Note that if one-shot breakpoint is set on several memory
pages 4096 bytes each, the remaining pages will not be automatically
unguarded. This function will not work on the Windows 95 based OSes.
Parameters:
base
(in) Base address of the memory block to guard. Windows align this address on the page boundary (4096 bytes)
size
(in) Size of the memory to guard. Windows align base+size to the next page boundary (4096 bytes)
guard
(in) Flag that indicates whether one-shot breakpoint should be set (guard!=0) or reset (guard=0).
It is allowed to set one-shot breakpoint onto the already guarded
memory range or attempt to remove breakpoint from the pages that are
not guarded
Return
values:
Returns 0 on success (all specified memory pages are guarded) and -1 on error (some pages remain unguarded)
See
also: