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.

118 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. memory.h
  5. Abstract:
  6. This is the header file that will be precompiled. Include this in all
  7. the source files
  8. Environment:
  9. User mode
  10. Revision History:
  11. 10/08/98 -felixw-
  12. Created it
  13. --*/
  14. #ifndef _MEMORY
  15. #define _MEMORY
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define LL_MEMORY_ERROR 0x00000100
  20. STDAPI_(PSTR)
  21. MemAllocStr_E(PSTR in);
  22. STDAPI_(PWSTR)
  23. MemAllocStrW_E(PWSTR in);
  24. STDAPI_(LPVOID)
  25. MemAlloc_E(DWORD dwBytes);
  26. STDAPI_(LPVOID)
  27. MemRealloc_E(LPVOID IpMem, DWORD dwBytes);
  28. DWORD
  29. MemSize(
  30. LPVOID pMem
  31. );
  32. LPVOID
  33. MemAlloc(
  34. DWORD cb
  35. );
  36. BOOL
  37. MemFree(
  38. LPVOID pMem
  39. );
  40. LPVOID
  41. MemRealloc(
  42. LPVOID pOldMem,
  43. DWORD cbOld,
  44. DWORD cbNew
  45. );
  46. PSTR
  47. MemAllocStr(
  48. PSTR pStr
  49. );
  50. PWSTR
  51. MemAllocStrW(
  52. PWSTR pStr
  53. );
  54. BOOL
  55. MemReallocStr(
  56. PSTR *ppStr,
  57. PSTR pStr
  58. );
  59. int UnicodeToAnsiString(PCWSTR pszUnicode,PSTR pszAnsi);
  60. PSTR AllocateAnsiString(PCWSTR pszUnicodeString);
  61. PWSTR AllocateUnicodeString(PCSTR pszAnsiString);
  62. int AnsiToUnicodeString(PCSTR pszAnsi,PWSTR pszUnicode);
  63. #if DBG
  64. extern LIST_ENTRY MemList ;
  65. extern CRITICAL_SECTION MemCritSect ;
  66. STDAPI_(VOID) InitMem(
  67. VOID
  68. ) ;
  69. VOID AssertMemLeaks(
  70. VOID
  71. ) ;
  72. VOID
  73. DumpMemoryTracker();
  74. #else
  75. #define InitMem()
  76. #define AssertMemLeaks()
  77. #define DumpMemoryTracker()
  78. #endif
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif // _MEMORY