ReactOS 0.4.16-dev-853-g88d9285
heapchk.cpp
Go to the documentation of this file.
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}
#define __cdecl
Definition: accygwin.h:79
#define _HEAPOK
Definition: malloc.h:29
#define _HEAPBADNODE
Definition: malloc.h:31
HANDLE __acrt_heap
Definition: heap_handle.cpp:15
int __cdecl _heapchk()
Definition: heapchk.cpp:15
BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
Definition: heapmem.c:156