mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.1 KiB
59 lines
1.1 KiB
/***
|
|
*heaphook.c - set the heap hook
|
|
*
|
|
* Copyright (c) 1995-2001, Microsoft Corporation. All rights reserved.
|
|
*
|
|
*Purpose:
|
|
* Defines the following functions:
|
|
* _setheaphook() - set the heap hook
|
|
*
|
|
*Revision History:
|
|
* 05-24-95 CFW Official ANSI C++ new handler added.
|
|
*
|
|
*******************************************************************************/
|
|
|
|
#ifdef HEAPHOOK
|
|
|
|
#include <cruntime.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef WINHEAP
|
|
#include <winheap.h>
|
|
#else
|
|
#include <heap.h>
|
|
#endif
|
|
|
|
_HEAPHOOK _heaphook = NULL;
|
|
|
|
/***
|
|
*_HEAPHOOK _setheaphook - set the heap hook
|
|
*
|
|
*Purpose:
|
|
* Allow testers/users/third-parties to hook in and monitor heap activity or
|
|
* add their own heap.
|
|
*
|
|
*Entry:
|
|
* _HEAPHOOK newhook - pointer to new heap hook routine
|
|
*
|
|
*Exit:
|
|
* Return old hook.
|
|
*
|
|
*Exceptions:
|
|
*
|
|
*******************************************************************************/
|
|
|
|
_CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK newhook)
|
|
{
|
|
_HEAPHOOK oldhook = _heaphook;
|
|
|
|
_heaphook = newhook;
|
|
|
|
return oldhook;
|
|
}
|
|
|
|
void _setinitheaphook(void)
|
|
{
|
|
|
|
}
|
|
|
|
#endif /* HEAPHOOK */
|