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.

114 lines
1.2 KiB

  1. #ifndef _MEMORY_H_INCLUDED_
  2. #define _MEMORY_H_INCLUDED_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. LPVOID
  7. AllocSPDMem(
  8. DWORD cb
  9. );
  10. BOOL
  11. FreeSPDMem(
  12. LPVOID pMem
  13. );
  14. LPVOID
  15. ReallocSPDMem(
  16. LPVOID pOldMem,
  17. DWORD cbOld,
  18. DWORD cbNew
  19. );
  20. LPWSTR
  21. AllocSPDStr(
  22. LPWSTR pStr
  23. );
  24. BOOL
  25. FreeSPDStr(
  26. LPWSTR pStr
  27. );
  28. BOOL
  29. ReallocSPDStr(
  30. LPWSTR *ppStr,
  31. LPWSTR pStr
  32. );
  33. DWORD
  34. AllocateSPDMemory(
  35. DWORD cb,
  36. LPVOID * ppMem
  37. );
  38. void
  39. FreeSPDMemory(
  40. LPVOID pMem
  41. );
  42. DWORD
  43. AllocateSPDString(
  44. LPWSTR pszString,
  45. LPWSTR * ppszNewString
  46. );
  47. void
  48. FreeSPDString(
  49. LPWSTR pszString
  50. );
  51. #if DBG
  52. extern LIST_ENTRY SPDMemList ;
  53. extern CRITICAL_SECTION SPDMemCritSect ;
  54. VOID InitSPDMem(
  55. VOID
  56. ) ;
  57. VOID AssertSPDMemLeaks(
  58. VOID
  59. ) ;
  60. VOID
  61. DumpMemoryTracker();
  62. #else
  63. #define InitSPDMem()
  64. #define AssertSPDMemLeaks()
  65. #define DumpMemoryTracker()
  66. #endif
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. /*
  71. inline void * _CRTAPI1
  72. operator new(size_t size)
  73. {
  74. return AllocSPDMem(size);
  75. }
  76. inline void _CRTAPI1
  77. operator delete(void * pv)
  78. {
  79. FreeSPDMem(pv);
  80. }*/
  81. #endif // _MEMORY_H_INCLUDED_
  82.