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.

45 lines
924 B

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. wlmacro.h
  5. Abstract:
  6. This header contains a collection of macros used by the wdm library.
  7. Author:
  8. Adrian J. Oney - April 21, 2002
  9. Revision History:
  10. --*/
  11. //
  12. // This is to make all the TEXT(...) macros come out right. As of 07/27/2000,
  13. // UNICODE isn't defined in kernel space by default.
  14. //
  15. #define UNICODE
  16. //
  17. // This macro takes an array and returns the number of elements in it.
  18. //
  19. #define ARRAY_COUNT(array) (sizeof(array)/sizeof(array[0]))
  20. //
  21. // This macro realigns a pointer to a pointer boundary.
  22. //
  23. #define ALIGN_POINTER(Offset) (PVOID) \
  24. ((((ULONG_PTR)(Offset) + sizeof(ULONG_PTR)-1)) & (~(sizeof(ULONG_PTR) - 1)))
  25. //
  26. // This macro realigns a ULONG_PTR offset onto a pointer boundary.
  27. //
  28. #define ALIGN_POINTER_OFFSET(Offset) (ULONG_PTR) ALIGN_POINTER(Offset)