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.

230 lines
4.5 KiB

  1. #ifndef _BLDR_KERNEL_DEFS
  2. #define _BLDR_KERNEL_DEFS
  3. #pragma warning(disable:4005)
  4. #define SEC_FAR
  5. #define FAR
  6. #define CONST const
  7. #define __stdcall
  8. #define __far
  9. #define __pascal
  10. #define __loadds
  11. #define IN
  12. #define OUT
  13. #define NULL ((void *)0)
  14. #define OPTIONAL
  15. typedef int BOOL;
  16. typedef char CHAR;
  17. typedef unsigned char UCHAR;
  18. typedef short SHORT;
  19. typedef unsigned short USHORT;
  20. typedef long LONG;
  21. typedef unsigned long ULONG;
  22. typedef unsigned long DWORD;
  23. typedef unsigned short WCHAR;
  24. typedef void *PVOID;
  25. typedef void VOID;
  26. typedef PVOID PSID;
  27. typedef LONG HRESULT;
  28. typedef UCHAR BOOLEAN;
  29. typedef BOOLEAN *PBOOLEAN;
  30. #if 1
  31. typedef struct _LUID {
  32. ULONG LowPart;
  33. LONG HighPart;
  34. } LUID, *PLUID;
  35. #else
  36. typedef long LUID, *PLUID;
  37. #endif
  38. typedef WCHAR *PWCHAR;
  39. typedef WCHAR *LPWCH, *PWCH;
  40. typedef CONST WCHAR *LPCWCH, *PCWCH;
  41. typedef WCHAR *NWPSTR;
  42. typedef WCHAR *LPWSTR, *PWSTR;
  43. typedef CONST WCHAR *LPCWSTR, *PCWSTR;
  44. typedef CHAR *PCHAR;
  45. typedef CHAR *LPCH, *PCH;
  46. typedef CONST CHAR *LPCCH, *PCCH;
  47. typedef CHAR *NPSTR;
  48. typedef CHAR *LPSTR, *PSTR;
  49. typedef CONST CHAR *LPCSTR, *PCSTR;
  50. typedef UCHAR *PUCHAR;
  51. typedef USHORT *PUSHORT;
  52. typedef ULONG *PULONG;
  53. #define _fstrcmp strcmp
  54. #define _fstrcpy strcpy
  55. #define _fstrlen strlen
  56. #define _fstrncmp strncmp
  57. #define _fmemcpy memcpy
  58. #define _fmemset memset
  59. #define _fmemcmp memcmp
  60. //
  61. // Definitions needed by arc.h.
  62. //
  63. typedef struct _DEVICE_FLAGS {
  64. ULONG Failed : 1;
  65. ULONG ReadOnly : 1;
  66. ULONG Removable : 1;
  67. ULONG ConsoleIn : 1;
  68. ULONG ConsoleOut : 1;
  69. ULONG Input : 1;
  70. ULONG Output : 1;
  71. } DEVICE_FLAGS, *PDEVICE_FLAGS;
  72. typedef struct _TIME_FIELDS {
  73. short Year; // range [1601...]
  74. short Month; // range [1..12]
  75. short Day; // range [1..31]
  76. short Hour; // range [0..23]
  77. short Minute; // range [0..59]
  78. short Second; // range [0..59]
  79. short Milliseconds;// range [0..999]
  80. short Weekday; // range [0..6] == [Sunday..Saturday]
  81. } TIME_FIELDS;
  82. typedef TIME_FIELDS *PTIME_FIELDS;
  83. //
  84. // __int64 is only supported by 2.0 and later midl.
  85. // __midl is set by the 2.0 midl and not by 1.0 midl.
  86. //
  87. #define _ULONGLONG_
  88. #if (!defined (_MAC) && (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64)))
  89. typedef __int64 LONGLONG;
  90. typedef unsigned __int64 ULONGLONG;
  91. #define MAXLONGLONG (0x7fffffffffffffff)
  92. #else
  93. #if defined(_MAC) && defined(_MAC_INT_64)
  94. typedef __int64 LONGLONG;
  95. typedef unsigned __int64 ULONGLONG;
  96. #define MAXLONGLONG (0x7fffffffffffffff)
  97. #else
  98. typedef double LONGLONG;
  99. typedef double ULONGLONG;
  100. #endif //_MAC and int64
  101. #endif
  102. typedef LONGLONG *PLONGLONG;
  103. typedef ULONGLONG *PULONGLONG;
  104. // Update Sequence Number
  105. typedef LONGLONG USN;
  106. #if defined(MIDL_PASS)
  107. typedef struct _LARGE_INTEGER {
  108. #else // MIDL_PASS
  109. typedef union _LARGE_INTEGER {
  110. struct {
  111. ULONG LowPart;
  112. LONG HighPart;
  113. };
  114. struct {
  115. ULONG LowPart;
  116. LONG HighPart;
  117. } u;
  118. #endif //MIDL_PASS
  119. LONGLONG QuadPart;
  120. } LARGE_INTEGER;
  121. typedef LARGE_INTEGER *PLARGE_INTEGER;
  122. #if defined(MIDL_PASS)
  123. typedef struct _ULARGE_INTEGER {
  124. #else // MIDL_PASS
  125. typedef union _ULARGE_INTEGER {
  126. struct {
  127. ULONG LowPart;
  128. ULONG HighPart;
  129. };
  130. struct {
  131. ULONG LowPart;
  132. ULONG HighPart;
  133. } u;
  134. #endif //MIDL_PASS
  135. ULONGLONG QuadPart;
  136. } ULARGE_INTEGER;
  137. typedef ULARGE_INTEGER *PULARGE_INTEGER;
  138. typedef struct _LIST_ENTRY {
  139. struct _LIST_ENTRY * volatile Flink;
  140. struct _LIST_ENTRY * volatile Blink;
  141. } LIST_ENTRY, *PLIST_ENTRY;
  142. #if defined(_AXP64_)
  143. #define KSEG0_BASE 0xffffffff80000000 // from halpaxp64.h
  144. #elif defined(_ALPHA_)
  145. #define KSEG0_BASE 0x80000000 // from halpalpha.h
  146. #endif
  147. #define POINTER_32
  148. #define FIRMWARE_PTR POINTER_32
  149. //
  150. // 16 byte aligned type for 128 bit floats
  151. //
  152. // *** TBD **** when compiler support is available:
  153. // typedef __float80 FLOAT128;
  154. // For we define a 128 bit structure and use force_align pragma to
  155. // align to 128 bits.
  156. //
  157. typedef struct _FLOAT128 {
  158. LONGLONG LowPart;
  159. LONGLONG HighPart;
  160. } FLOAT128;
  161. typedef FLOAT128 *PFLOAT128;
  162. #if defined(_M_IA64)
  163. #pragma force_align _FLOAT128 16
  164. #endif // _M_IA64
  165. #if defined(_WIN64)
  166. typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
  167. #else
  168. typedef unsigned long ULONG_PTR, *PULONG_PTR;
  169. #endif
  170. typedef unsigned char BYTE, *PBYTE;
  171. typedef ULONG_PTR KSPIN_LOCK;
  172. typedef KSPIN_LOCK *PKSPIN_LOCK;
  173. //
  174. // Interrupt Request Level (IRQL)
  175. //
  176. typedef UCHAR KIRQL;
  177. typedef KIRQL *PKIRQL;
  178. #include <arc.h>
  179. #endif