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.

73 lines
1.6 KiB

  1. //**************************************************************************
  2. //
  3. // Title : Mem.cpp
  4. //
  5. // Date : 1997.12.08 1st making
  6. //
  7. // Author : Toshiba [PCS](PSY) Hideki Yagi
  8. //
  9. // Copyright 1997 Toshiba Corporation. All Rights Reserved.
  10. //
  11. // -------------------------------------------------------------------------
  12. //
  13. // Change log :
  14. //
  15. // Date Revision Description
  16. // ------------ ---------- -----------------------------------------------
  17. // 1997.12.08 000.0000 1st making.
  18. // 98.01.20 000.0001 Append _fltused and _purecall() function.
  19. //
  20. //
  21. //**************************************************************************
  22. #include "includes.h"
  23. /*******************************
  24. #ifndef _PNH_DEFINED
  25. typedef int (__cdecl* _PNH)( size_t );
  26. #define _PNH_DEFINED
  27. #endif
  28. int _cdecl __default_nh( size_t )
  29. {
  30. return 0;
  31. };
  32. _PNH __newhandler = __default_nh;
  33. _PNH _cdecl _set_new_handler( _PNH handler )
  34. {
  35. ASSERT( NULL!= handler );
  36. _PNH oldhandler = __newhandler;
  37. __newhandler = handler;
  38. return oldhandler;
  39. }
  40. *****************************************/
  41. PVOID _cdecl ::operator new( size_t size )
  42. {
  43. ASSERT( KeGetCurrentIrql() <= DISPATCH_LEVEL );
  44. PVOID p = ExAllocatePool( NonPagedPool, size );
  45. if(!p){
  46. DBG_BREAK();
  47. }
  48. return( p );
  49. }
  50. VOID _cdecl ::operator delete( PVOID p )
  51. {
  52. ASSERT( p!=NULL );
  53. ExFreePool( p );
  54. }
  55. extern "C" const int _fltused = 0;
  56. int __cdecl _purecall( void )
  57. {
  58. return( FALSE );
  59. }