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.

37 lines
1.3 KiB

  1. /***
  2. *_newmode.c - set new() handler mode to not handle malloc failures
  3. *
  4. * Copyright (c) 1994-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Sets the global flag which controls whether the new() handler
  8. * is called on malloc failures. The default behavior in Visual
  9. * C++ v2.0 and later is not to, that malloc failures return NULL
  10. * without calling the new handler. This object is linked in unless
  11. * the special object NEWMODE.OBJ is manually linked.
  12. *
  13. * This source file is the complement of LINKOPTS/NEWMODE.C.
  14. *
  15. *Revision History:
  16. * 03-04-94 SKS Original version.
  17. * 04-14-94 GJF Added conditionals so this definition doesn't make
  18. * it into the Win32s version of msvcrt*.dll.
  19. * 05-02-95 GJF Propagated over _NTSDK stuff from winheap version
  20. * (for compatability with the old crtdll.dll).
  21. * 05-13-99 PML Remove Win32s
  22. *
  23. *******************************************************************************/
  24. #ifndef _POSIX_
  25. #include <internal.h>
  26. /* enable new handler calls upon malloc failures */
  27. #ifdef _NTSDK
  28. int _newmode = 1; /* Malloc New Handler MODE */
  29. #else
  30. int _newmode = 0; /* Malloc New Handler MODE */
  31. #endif
  32. #endif