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.

32 lines
911 B

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. macros.h
  5. Abstract:
  6. This module contains the global macros
  7. --*/
  8. #ifndef _MACROS_H
  9. #define _MACROS_H
  10. HANDLE g_HeapHandle; // g_HeapHandle is the global handle to the heap
  11. // MemInitializeMacro is a macro to get the handle to the heap
  12. #define MemInitializeMacro(hHeap) (g_HeapHandle = hHeap)
  13. // MemAllocMacro is a macro to allocate dwBytes bytes of memory from the heap
  14. #define MemAllocMacro(dwBytes) (HeapAlloc(g_HeapHandle, HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, dwBytes))
  15. // MemReAllocMacro is a macro to reallocate dwBytes bytes of memory from the heap
  16. #define MemReAllocMacro(lpMem, dwBytes) (HeapReAlloc(g_HeapHandle, HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, lpMem, dwBytes))
  17. // MemFreeMacro is a macro to free a memory block allocated from the heap
  18. #define MemFreeMacro(lpMem) (HeapFree(g_HeapHandle, 0, lpMem))
  19. #endif