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.

145 lines
4.2 KiB

  1. /*** basedef.h - Basic definitions
  2. *
  3. * Copyright (c) 1989,1992,1993 Microsoft Corporation
  4. * Author: Michael Tsang (MTS)
  5. * Created 01/06/89
  6. *
  7. * This module contains basic constants and types
  8. *
  9. * MODIFICATION HISTORY
  10. */
  11. #pragma warning (disable: 4001)
  12. /*** Commonly used constants
  13. */
  14. #ifndef NULL
  15. #define NULL 0
  16. #endif
  17. #ifndef FALSE
  18. #define FALSE 0
  19. #endif
  20. #ifndef TRUE
  21. #define TRUE 1
  22. #endif
  23. #define CDECL __cdecl
  24. #define PASCAL __pascal
  25. #if defined(IS_32) || defined(_WIN32_WINNT)
  26. #define FAR
  27. #define NEAR
  28. #else
  29. #define FAR __far
  30. #define NEAR __near
  31. #endif
  32. /*** Base type declarations
  33. */
  34. typedef void VOID;
  35. typedef char CHAR; //ch
  36. typedef unsigned char UCHAR; //uch
  37. typedef int INT; //i
  38. typedef unsigned int UINT; //ui
  39. typedef short SHORT; //s
  40. typedef unsigned short USHORT; //us
  41. typedef long LONG; //l
  42. typedef unsigned long ULONG; //ul
  43. typedef __int64 LONGLONG; //ll
  44. typedef unsigned __int64 ULONGLONG; //ull
  45. typedef ULONG ULONG_PTR; //uip
  46. typedef UCHAR BYTE; //b
  47. typedef USHORT WORD; //w
  48. typedef ULONG DWORD; //dw
  49. typedef ULONGLONG QWORD; //qw
  50. typedef UINT BOOL; //f
  51. typedef UCHAR BBOOL; //bf
  52. typedef USHORT SBOOL; //sf
  53. typedef ULONG LBOOL; //lf
  54. typedef ULONG FLAGS; //fl
  55. #if defined(_WIN64)
  56. typedef unsigned __int64 HANDLE; //h
  57. #else
  58. typedef ULONG HANDLE; //h
  59. #endif
  60. /*** Pointer types to base types declarations
  61. */
  62. typedef VOID * PVOID; //pv
  63. typedef VOID FAR * LPVOID; //lpv
  64. typedef CHAR * PCHAR; //pch
  65. typedef CHAR FAR * LPCHAR; //lpch
  66. typedef UCHAR * PUCHAR; //puch
  67. typedef UCHAR FAR * LPUCHAR; //lpuch
  68. typedef INT * PINT; //pi
  69. typedef INT FAR * LPINT; //lpi
  70. typedef UINT * PUINT; //pui
  71. typedef UINT FAR * LPUINT; //lpui
  72. typedef SHORT * PSHORT; //ps
  73. typedef SHORT FAR * LPSHORT; //lps
  74. typedef USHORT * PUSHORT; //pus
  75. typedef USHORT FAR * LPUSHORT; //lpus
  76. typedef LONG * PLONG; //pl
  77. typedef LONG FAR * LPLONG; //lpl
  78. typedef ULONG * PULONG; //pul
  79. typedef ULONG FAR * LPULONG; //lpul
  80. typedef BYTE * PBYTE; //pb
  81. typedef BYTE FAR * LPBYTE; //lpb
  82. typedef WORD * PWORD; //pw
  83. typedef WORD FAR * LPWORD; //lpw
  84. typedef DWORD * PDWORD; //pdw
  85. typedef DWORD FAR * LPDWORD; //lpdw
  86. typedef BOOL * PBOOL; //pf
  87. typedef BOOL FAR * LPBOOL; //lpf
  88. typedef BBOOL * PBBOOL; //pbf
  89. typedef BBOOL FAR * LPBBOOL; //lpbf
  90. typedef SBOOL * PSBOOL; //psf
  91. typedef SBOOL FAR * LPSBOOL; //lpsf
  92. typedef LBOOL * PLBOOL; //plf
  93. typedef LBOOL FAR * LPLBOOL; //lplf
  94. typedef FLAGS * PFLAGS; //pfl
  95. typedef FLAGS FAR * LPFLAGS; //lpfl
  96. /*** Double indirection pointer types to base types declarations
  97. */
  98. typedef PVOID * PPVOID; //ppv
  99. typedef PVOID FAR * LPPVOID; //lppv
  100. /*** Other common types (and their pointers)
  101. */
  102. typedef CHAR * PSZ; //psz
  103. typedef CHAR FAR * LPSZ; //lpsz
  104. typedef CHAR FAR * LPSTR; //lpstr
  105. /*** Constants
  106. */
  107. #define MAX_BYTE 0xff
  108. #define MAX_WORD 0xffff
  109. #define MAX_DWORD 0xffffffff
  110. /*** Macros
  111. */
  112. #define DEREF(x) ((x) = (x))
  113. #define EXPORT CDECL
  114. #define LOCAL CDECL
  115. #define BYTEOF(d,i) (((BYTE *)&(d))[i])
  116. #define WORDOF(d,i) (((WORD *)&(d))[i])
  117. //
  118. // EFNfix: This is a slimy hack to include acpitabl.h, why are we not using
  119. // standard types ?
  120. //
  121. typedef BOOL BOOLEAN;