Source code of Windows XP (NT5)
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.

58 lines
1.3 KiB

  1. /***
  2. *dbghook.c - Debug CRT Hook Functions
  3. *
  4. * Copyright (c) 1988-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Allow users to override default alloc hook at link time.
  8. *
  9. *Revision History:
  10. * 11-28-94 CFW Module created.
  11. * 12-14-94 CFW Remove incorrect comments.
  12. * 01-09-94 CFW Filename pointers are const.
  13. * 02-09-95 CFW PMac work.
  14. * 06-27-95 CFW Add win32s support for debug libs.
  15. * 05-13-99 PML Remove Win32s
  16. *
  17. *******************************************************************************/
  18. #ifdef _DEBUG
  19. #include <internal.h>
  20. #include <limits.h>
  21. #include <mtdll.h>
  22. #include <malloc.h>
  23. #include <stdlib.h>
  24. #include <dbgint.h>
  25. _CRT_ALLOC_HOOK _pfnAllocHook = _CrtDefaultAllocHook;
  26. /***
  27. *int _CrtDefaultAllocHook() - allow allocation
  28. *
  29. *Purpose:
  30. * allow allocation
  31. *
  32. *Entry:
  33. * all parameters ignored
  34. *
  35. *Exit:
  36. * returns TRUE
  37. *
  38. *Exceptions:
  39. *
  40. *******************************************************************************/
  41. int __cdecl _CrtDefaultAllocHook(
  42. int nAllocType,
  43. void * pvData,
  44. size_t nSize,
  45. int nBlockUse,
  46. long lRequest,
  47. const unsigned char * szFileName,
  48. int nLine
  49. )
  50. {
  51. return 1; /* allow all allocs/reallocs/frees */
  52. }
  53. #endif /* _DEBUG */