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.

37 lines
964 B

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. macros.h
  5. Abstract:
  6. This module contains the global macros
  7. Author:
  8. Steven Kehrli (steveke) 11/15/1997
  9. --*/
  10. #ifndef _MACROS_H
  11. #define _MACROS_H
  12. HINSTANCE g_hInstance = NULL; // g_hInstance is the handle to the instance
  13. HANDLE hProcessHeap = NULL; // hProcessHeap is a handle to the process heap
  14. // MemInitializeMacro is a macro to get the handle to the process heap
  15. #define MemInitializeMacro() (hProcessHeap = GetProcessHeap())
  16. // MemAllocMacro is a macro to allocate dwBytes bytes of memory from the process heap
  17. #define MemAllocMacro(dwBytes) (HeapAlloc(hProcessHeap, HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, dwBytes))
  18. // MemFreeMacro is a macro to free a memory block allocated from the process heap
  19. #define MemFreeMacro(lpMem) (HeapFree(hProcessHeap, 0, lpMem))
  20. // MAX_STRINGLEN is the text length limit of a character string resource
  21. #define MAX_STRINGLEN 255
  22. #endif