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.

48 lines
1.1 KiB

  1. #ifndef _TSUNAMI_MEM_H_INCLUDED_
  2. #define _TSUNAMI_MEM_H_INCLUDED_
  3. #include <irtlmisc.h>
  4. #if DBG
  5. PVOID DbgAllocateHeap
  6. (
  7. IN PCHAR File,
  8. IN int Line,
  9. IN ULONG Flags,
  10. IN ULONG Size
  11. );
  12. PVOID DbgReAllocateHeap
  13. (
  14. IN PCHAR File,
  15. IN int Line,
  16. IN ULONG Flags,
  17. IN PVOID pvOld,
  18. IN ULONG Size
  19. );
  20. BOOL DbgFreeHeap
  21. (
  22. IN PCHAR File,
  23. IN int Line,
  24. IN ULONG Flags,
  25. IN PVOID pvOld
  26. );
  27. #define ALLOC( Size ) (DbgAllocateHeap( __FILE__, __LINE__, 0, (Size) ) )
  28. #define TYPE_ALLOC( Type ) (ALLOC( sizeof( Type )))
  29. #define FREE( pv ) (DbgFreeHeap( __FILE__, __LINE__, 0, (pv) ))
  30. #define REALLOC( pv, Size ) (DbgReAllocateHeap( __FILE__, __LINE__, 0, pv, Size ) )
  31. #else // DBG
  32. #define ALLOC( Size ) (IisCalloc(Size) )
  33. #define TYPE_ALLOC( Type ) (ALLOC( sizeof( Type )))
  34. #define FREE( pv ) (IisFree( (pv) ))
  35. #define REALLOC( pv, Size ) ((PVOID) IisReAlloc( pv, Size ) )
  36. #endif // DBG
  37. #endif // INCLUDED