memmgr.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. /*
  2.  * memmgr.h - Memory manager module description.
  3.  */
  4. /* Macros
  5.  *********/
  6. #ifdef DEBUG
  7. #define AllocateMemory(size, ppv)   (GpcszElemHdrSize = TEXT(#size), GpcszElemHdrFile = TEXT(__FILE__), GulElemHdrLine = __LINE__, MyAllocateMemory(size, ppv))
  8. #else
  9. #define AllocateMemory(size, ppv)   MyAllocateMemory(size, ppv)
  10. #endif   /* DEBUG */
  11. /* Types
  12.  ********/
  13. #ifdef DEBUG
  14. /* SpewHeapSummary() flags */
  15. typedef enum _spewheapsummaryflags
  16. {
  17.    /* Spew description of each remaining used element. */
  18.    SHS_FL_SPEW_USED_INFO            = 0x0001,
  19.    /* flag combinations */
  20.    ALL_SHS_FLAGS                    = SHS_FL_SPEW_USED_INFO
  21. }
  22. SPEWHEAPSUMMARYFLAGS;
  23. #endif
  24. /* Prototypes
  25.  *************/
  26. /* memmgr.c */
  27. extern BOOL InitMemoryManagerModule(void);
  28. extern void ExitMemoryManagerModule(void);
  29. extern COMPARISONRESULT MyMemComp(PCVOID, PCVOID, DWORD);
  30. extern BOOL MyAllocateMemory(DWORD, PVOID *);
  31. extern void FreeMemory(PVOID);
  32. extern BOOL ReallocateMemory(PVOID, DWORD, PVOID *);
  33. extern DWORD GetMemorySize(PVOID);
  34. #ifdef DEBUG
  35. extern BOOL SetMemoryManagerModuleIniSwitches(void);
  36. extern void SpewHeapSummary(DWORD);
  37. #endif
  38. /* Global Variables
  39.  *******************/
  40. #ifdef DEBUG
  41. /* parameters used by debug version of AllocateMemory() */
  42. extern LPCTSTR GpcszElemHdrSize;
  43. extern LPCTSTR GpcszElemHdrFile;
  44. extern ULONG GulElemHdrLine;
  45. #endif