Kernel32HeapValidate Method

Validates the specified heap.

The function scans all the memory blocks in the heap and verifies that the heap control structures maintained by the heap manager are in a consistent state.

You can also use the HeapValidate(IntPtr, HeapFlags, IntPtr) function to validate a single memory block within a specified heap without checking the validity of the entire heap.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll")]
public static bool HeapValidate(
	IntPtr hHeap,
	HeapFlags flags,
	IntPtr mem
)

Parameters

hHeap  IntPtr
A handle to the heap to be validated.

This handle is returned by either the HeapCreate(HeapFlags, UInt32, UInt32) or GetProcessHeap function.

flags  HeapFlags
The heap access options.
mem  IntPtr
A pointer to a memory block within the specified heap. This parameter may be Zero.

If this parameter is Zero, the function attempts to validate the entire heap specified by hHeap.

If this parameter is not Zero, the function attempts to validate the memory block pointed to by mem. It does not attempt to validate the rest of the heap.

Return Value

Boolean
If the specified heap or memory block is valid, the return value is .

If the specified heap or memory block is invalid, the return value is .

On a system set up for debugging, the HeapValidate(IntPtr, HeapFlags, IntPtr) function then displays debugging messages that describe the part of the heap or memory block that is invalid, and stops at a hard-coded breakpoint so that you can examine the system to determine the source of the invalidity.

The HeapValidate(IntPtr, HeapFlags, IntPtr) function does not set the thread's last error value.

There is no extended error information for this function; do not call GetLastWin32Error.

Remarks

See Also