Platform SDK: Memory |
The ResetWriteWatch function resets the write-tracking state for a region of virtual memory. Subsequent calls to the GetWriteWatch function will only report pages that have been written to since the reset operation.
UINT ResetWriteWatch( LPVOID lpBaseAddress, // base address SIZE_T dwRegionSize // size of memory region );
If the function succeeds, the return value is zero.
If the function fails, the return value is a nonzero value.
The ResetWriteWatch function can be useful to an application such as a garbage collector. The application calls the GetWriteWatch function to retrieve the list of written pages and then writes to those pages as part of its cleanup operation. Then the garbage collector calls ResetWriteWatch to remove the write-tracking records caused by its cleanup.
You can also reset the write-tracking state of a memory region by specifying WRITE_WATCH_FLAG_RESET when you call GetWriteWatch.
If you use ResetWriteWatch, you must ensure that no threads write to the region during the interval between the GetWriteWatch and ResetWriteWatch calls. Otherwise, there may be written pages that you fail to detect.
Windows NT/2000: Unsupported.
Windows 95/98: Requires Windows 98.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Memory Management Overview, Memory Management Functions, GetWriteWatch, VirtualAlloc