다음을 통해 공유


HeapValidate (Windows CE 5.0)

Send Feedback

This function validates the specified heap. HeapValidate 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. The HeapValidate function can also be used to validate a single memory block within a specified heap without checking the validity of the entire heap.

BOOL HeapValidate(HANDLEhHeap,DWORDdwFlags,LPCVOIDlpMem );

Parameters

  • hHeap
    [in] Handle to the heap to be validated.

    This parameter is a handle returned by the HeapCreate or GetProcessHeap function.

  • dwFlags
    [in] Heap access options.

    The following table shows the flag you can specify.

    Value Description
    HEAP_NO_SERIALIZE Is ignored. The heap is always serialized.
  • lpMem
    [in] Valid pointer to a memory block within the specified heap. This parameter may be NULL.

    If this parameter is NULL, the function attemptions to validate the entire heap specified by hHeap.

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

Return Values

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

If the specified heap or memory block is invalid, the return value is zero. On a system set up for debugging, the HeapValidate function 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 function does not set the thread's last error value. There is no extended error information for this function; do not call GetLastError.

Remarks

There are heap control structures for each memory block in a heap and for the heap as a whole. When you use the HeapValidate function to validate a complete heap, it checks all of these control structures for consistency.

When you use HeapValidate to validate a single memory block within a heap, it checks only the control structures pertaining to that element. HeapValidate can only validate allocated memory blocks. Calling HeapValidate on a freed memory block returns FALSE because there are no control structures to validate.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib.

See Also

GetProcessHeap | GetLastError | HeapCreate

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.