void ValidateFreeSpaces(void) |
The ValidateFreeSpaces function checks free segments in memory for valid contents. This function is available only in the debugging version of Windows.
This function has no parameters.
This function does not return a value.
In the debugging version of Windows, the kernel fills all the bytes in free segments with the hexadecimal value 0x0CC. This function begins checking for valid contents in the free segment with the lowest address; it continues checking until it finds an invalid byte or until it has determined that all free space contains valid contents. Before calling this function, put the following lines in the WIN.INI file:
[KERNEL]
EnableFreeChecking=1
EnableHeapChecking=1
Windows sends debugging information to the debugging terminal if an invalid byte is encountered, and then it performs a fatal exit.
The [KERNEL] entries in WIN.INI cause automatic checking of free memory. Before returning a memory object to the application in response to a call to the GlobalAlloc function, Windows checks that memory to make sure it is filled with 0x0CC. Before a call to the GlobalCompact function, all free memory is checked. Note that using this function slows Windows system-wide by about twenty percent.