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.

57 lines
533 B

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. common.inl
  6. Abstract:
  7. Defines common inlines
  8. Author:
  9. Albert Ting (AlbertT) 21-May-1994
  10. Revision History:
  11. --*/
  12. inline
  13. DWORD
  14. DWordAlign(
  15. DWORD dw
  16. )
  17. {
  18. return ((dw)+3)&~3;
  19. }
  20. inline
  21. PVOID
  22. DWordAlignDown(
  23. PVOID pv
  24. )
  25. {
  26. return (PVOID)((ULONG_PTR)pv&~3);
  27. }
  28. inline
  29. PVOID
  30. WordAlignDown(
  31. PVOID pv
  32. )
  33. {
  34. return (PVOID)((ULONG_PTR)pv&~1);
  35. }
  36. inline
  37. DWORD
  38. Align(
  39. DWORD dw
  40. )
  41. {
  42. return (dw+7)&~7;
  43. }