Reactos
1//
2// heapchk.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Implementation of _heapchk().
7//
8#include <corecrt_internal.h>
9#include <malloc.h>
10
11// Performs a consistency check on the heap. The return value is one of the
12// following:
13// * _HEAPOK The validation of the heap completed successfully
14// * _HEAPBADNODE Some node in the heap is malformed and the heap is corrupt
15extern "C" int __cdecl _heapchk()
16{
17 if (!HeapValidate(__acrt_heap, 0, nullptr))
18 return _HEAPBADNODE;
19
20 return _HEAPOK;
21}