Leaked source code of windows server 2003
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.2 KiB

  1. /***
  2. *heaphook.c - set the heap hook
  3. *
  4. * Copyright (c) 1995-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines the following functions:
  8. * _setheaphook() - set the heap hook
  9. *
  10. *Revision History:
  11. * 05-24-95 CFW Official ANSI C++ new handler added.
  12. *
  13. *******************************************************************************/
  14. #ifdef HEAPHOOK
  15. #include <cruntime.h>
  16. #include <stddef.h>
  17. #ifdef WINHEAP
  18. #include <winheap.h>
  19. #else
  20. #include <heap.h>
  21. #endif
  22. _HEAPHOOK _heaphook = NULL;
  23. /***
  24. *_HEAPHOOK _setheaphook - set the heap hook
  25. *
  26. *Purpose:
  27. * Allow testers/users/third-parties to hook in and monitor heap activity or
  28. * add their own heap.
  29. *
  30. *Entry:
  31. * _HEAPHOOK newhook - pointer to new heap hook routine
  32. *
  33. *Exit:
  34. * Return old hook.
  35. *
  36. *Exceptions:
  37. *
  38. *******************************************************************************/
  39. _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK newhook)
  40. {
  41. _HEAPHOOK oldhook = _heaphook;
  42. _heaphook = newhook;
  43. return oldhook;
  44. }
  45. void _setinitheaphook(void)
  46. {
  47. }
  48. #endif /* HEAPHOOK */