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.

214 lines
4.9 KiB

  1. /*** BASEDEF.H
  2. *
  3. * Basic constants and types for the VMM and VxDs
  4. * Copyright (c) 1988,1989 Microsoft Corporation
  5. *
  6. * NOBASEDEFS turns off the base definations
  7. */
  8. #ifndef NOBASEDEFS
  9. #define NOBASEDEFS
  10. /*
  11. * No warnings generated on non-standard usuage such as double
  12. * slash for comments
  13. */
  14. #pragma warning (disable:4206)
  15. #pragma warning (disable:4214)
  16. #pragma warning (disable:4201)
  17. #pragma warning (disable:4505)
  18. #pragma warning (disable:4514)
  19. #pragma warning (disable:4001)
  20. #ifndef FALSE
  21. #define FALSE 0
  22. #endif
  23. #ifndef TRUE
  24. #define TRUE 1
  25. #endif
  26. #ifndef NULL
  27. #define NULL '\0' // Null pointer
  28. #endif
  29. #define CDECL _cdecl
  30. #define PASCAL _pascal
  31. #define VOID void
  32. #define CONST const
  33. #define VOLATILE volatile
  34. typedef int INT; // i
  35. typedef unsigned int UINT; // u
  36. typedef int BOOL; // f
  37. typedef unsigned char BYTE; // b
  38. typedef unsigned short WORD; // w
  39. typedef unsigned long DWORD; // dw
  40. #ifndef _H2INC
  41. typedef struct qword_s { /* qword */
  42. DWORD qword_lo;
  43. DWORD qword_hi;
  44. } QWORD; // qw
  45. #endif
  46. #ifndef _NTDEF_
  47. typedef char CHAR; // ch
  48. typedef unsigned char UCHAR; // uch
  49. typedef short SHORT; // s
  50. typedef unsigned short USHORT; // us
  51. typedef long LONG; // l
  52. typedef unsigned long ULONG; // ul
  53. typedef UCHAR *PSZ; // psz
  54. typedef VOID *PVOID; // p
  55. typedef PVOID *PPVOID; // pp
  56. /*XLATOFF*/
  57. #if (_MSC_VER >= 900)
  58. #if (!defined(MIDL_PASS) || defined(__midl))
  59. typedef __int64 LONGLONG;
  60. typedef unsigned __int64 ULONGLONG;
  61. #define MAXLONGLONG (0x7fffffffffffffff)
  62. #else
  63. typedef double LONGLONG;
  64. typedef double ULONGLONG;
  65. #endif
  66. typedef LONGLONG *PLONGLONG;
  67. typedef ULONGLONG *PULONGLONG;
  68. // Update Sequence Number
  69. typedef LONGLONG USN;
  70. #if defined(MIDL_PASS)
  71. struct _LARGE_INTEGER {
  72. #else // MIDL_PASS
  73. union _LARGE_INTEGER {
  74. struct _LARGE_INTERGER1 {
  75. ULONG LowPart;
  76. LONG HighPart;
  77. };
  78. struct _LARGE_INTERGER2 {
  79. ULONG LowPart;
  80. LONG HighPart;
  81. } u;
  82. #endif //MIDL_PASS
  83. LONGLONG QuadPart;
  84. };
  85. #if defined(MIDL_PASS)
  86. typedef struct _LARGE_INTEGER LARGE_INTEGER;
  87. #else
  88. typedef union _LARGE_INTEGER LARGE_INTEGER;
  89. #endif
  90. typedef LARGE_INTEGER *PLARGE_INTEGER;
  91. #if defined(MIDL_PASS)
  92. struct _ULARGE_INTEGER {
  93. #else // MIDL_PASS
  94. union _ULARGE_INTEGER {
  95. struct _LARGE_INTERGER3 {
  96. ULONG LowPart;
  97. ULONG HighPart;
  98. };
  99. struct _LARGE_INTERGER4 {
  100. ULONG LowPart;
  101. ULONG HighPart;
  102. } u;
  103. #endif //MIDL_PASS
  104. ULONGLONG QuadPart;
  105. };
  106. #if defined(MIDL_PASS)
  107. typedef struct _ULARGE_INTEGER ULARGE_INTEGER;
  108. #else
  109. typedef union _ULARGE_INTEGER ULARGE_INTEGER;
  110. #endif
  111. typedef ULARGE_INTEGER *PULARGE_INTEGER;
  112. #else // of MSC_VER > 900
  113. #ifndef _H2INC
  114. typedef struct _LARGE_INTEGER {
  115. ULONG LowPart;
  116. LONG HighPart;
  117. } LARGE_INTEGER, *PLARGE_INTEGER;
  118. typedef struct _ULARGE_INTEGER {
  119. ULONG LowPart;
  120. ULONG HighPart;
  121. } ULARGE_INTEGER;
  122. #endif
  123. #endif
  124. /*XLATON*/
  125. #else
  126. typedef PVOID *PPVOID; // pp
  127. #endif
  128. typedef INT *PINT; // pi
  129. typedef UINT *PUINT; // pu
  130. typedef BYTE *PBYTE; // pb
  131. typedef WORD *PWORD; // pw
  132. typedef DWORD *PDWORD; // pdw
  133. typedef CHAR *PCHAR; // pch
  134. typedef SHORT *PSHORT; // ps
  135. typedef LONG *PLONG; // pl
  136. typedef UCHAR *PUCHAR; // puch
  137. typedef USHORT *PUSHORT; // pus
  138. typedef ULONG *PULONG; // pul
  139. typedef BOOL *PBOOL; // pf
  140. typedef UCHAR SZ[]; // sz
  141. typedef UCHAR SZZ[]; // szz
  142. typedef UCHAR *PSZZ; // pszz
  143. typedef USHORT SEL; // sel
  144. typedef SEL *PSEL; // psel
  145. typedef ULONG PPHYS; // pphys
  146. typedef (*PFN)(); // pfn
  147. typedef PFN *PPFN; // ppfn
  148. typedef PVOID HANDLE; // h
  149. typedef HANDLE *PHANDLE; // ph
  150. typedef ULONG HTIMEOUT; // timeout handle
  151. typedef ULONG CMS; // count of milliseconds
  152. #ifndef NOMINMAX
  153. #ifndef max
  154. #define max(a,b) (((a) > (b)) ? (a) : (b))
  155. #endif
  156. #ifndef min
  157. #define min(a,b) (((a) < (b)) ? (a) : (b))
  158. #endif
  159. #endif // NOMINMAX
  160. #define MAKEWORD(a, b) ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
  161. #define MAKELONG(a, b) ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
  162. #define LOWORD(l) ((WORD)(l))
  163. #define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  164. #define LOBYTE(w) ((BYTE)(w))
  165. #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
  166. #endif // NOBASEDEFS