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.

224 lines
4.6 KiB

  1. /*++ BUILD Version: 0003 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntkeapi.h
  5. Abstract:
  6. This module contains the include file for data types that are exported
  7. by kernel for general use.
  8. Author:
  9. David N. Cutler (davec) 27-Jul-1989
  10. Environment:
  11. Any mode.
  12. Revision History:
  13. --*/
  14. #ifndef _NTKEAPI_
  15. #define _NTKEAPI_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. // begin_ntddk begin_wdm begin_ntifs begin_nthal
  23. #define LOW_PRIORITY 0 // Lowest thread priority level
  24. #define LOW_REALTIME_PRIORITY 16 // Lowest realtime priority level
  25. #define HIGH_PRIORITY 31 // Highest thread priority level
  26. #define MAXIMUM_PRIORITY 32 // Number of thread priority levels
  27. // begin_winnt
  28. #define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of wait objects
  29. #define MAXIMUM_SUSPEND_COUNT MAXCHAR // Maximum times thread can be suspended
  30. // end_winnt
  31. //
  32. // Define system time structure.
  33. //
  34. typedef struct _KSYSTEM_TIME {
  35. ULONG LowPart;
  36. LONG High1Time;
  37. LONG High2Time;
  38. } KSYSTEM_TIME, *PKSYSTEM_TIME;
  39. //
  40. // Thread priority
  41. //
  42. typedef LONG KPRIORITY;
  43. //
  44. // Spin Lock
  45. //
  46. // begin_ntndis begin_winnt
  47. typedef ULONG_PTR KSPIN_LOCK;
  48. typedef KSPIN_LOCK *PKSPIN_LOCK;
  49. // end_ntndis end_winnt end_wdm
  50. //
  51. // Define per processor lock queue structure.
  52. //
  53. // N.B. The lock field of the spin lock queue structure contains the address
  54. // of the associated kernel spin lock, an owner bit, and a lock bit. Bit
  55. // 0 of the spin lock address is the wait bit and bit 1 is the owner bit.
  56. // The use of this field is such that the bits can be set and cleared
  57. // noninterlocked, however, the back pointer must be preserved.
  58. //
  59. // The lock wait bit is set when a processor enqueues itself on the lock
  60. // queue and it is not the only entry in the queue. The processor will
  61. // spin on this bit waiting for the lock to be granted.
  62. //
  63. // The owner bit is set when the processor owns the respective lock.
  64. //
  65. // The next field of the spin lock queue structure is used to line the
  66. // queued lock structures together in fifo order. It also can set set and
  67. // cleared noninterlocked.
  68. //
  69. #define LOCK_QUEUE_WAIT 1
  70. #define LOCK_QUEUE_OWNER 2
  71. typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
  72. LockQueueDispatcherLock,
  73. LockQueueContextSwapLock,
  74. LockQueuePfnLock,
  75. LockQueueSystemSpaceLock,
  76. LockQueueVacbLock,
  77. LockQueueMasterLock,
  78. LockQueueNonPagedPoolLock,
  79. LockQueueIoCancelLock,
  80. LockQueueWorkQueueLock,
  81. LockQueueIoVpbLock,
  82. LockQueueIoDatabaseLock,
  83. LockQueueIoCompletionLock,
  84. LockQueueNtfsStructLock,
  85. LockQueueAfdWorkQueueLock,
  86. LockQueueBcbLock,
  87. LockQueueMaximumLock
  88. } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
  89. typedef struct _KSPIN_LOCK_QUEUE {
  90. struct _KSPIN_LOCK_QUEUE * volatile Next;
  91. PKSPIN_LOCK volatile Lock;
  92. } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
  93. typedef struct _KLOCK_QUEUE_HANDLE {
  94. KSPIN_LOCK_QUEUE LockQueue;
  95. KIRQL OldIrql;
  96. } KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
  97. // begin_wdm
  98. //
  99. // Interrupt routine (first level dispatch)
  100. //
  101. typedef
  102. VOID
  103. (*PKINTERRUPT_ROUTINE) (
  104. VOID
  105. );
  106. //
  107. // Profile source types
  108. //
  109. typedef enum _KPROFILE_SOURCE {
  110. ProfileTime,
  111. ProfileAlignmentFixup,
  112. ProfileTotalIssues,
  113. ProfilePipelineDry,
  114. ProfileLoadInstructions,
  115. ProfilePipelineFrozen,
  116. ProfileBranchInstructions,
  117. ProfileTotalNonissues,
  118. ProfileDcacheMisses,
  119. ProfileIcacheMisses,
  120. ProfileCacheMisses,
  121. ProfileBranchMispredictions,
  122. ProfileStoreInstructions,
  123. ProfileFpInstructions,
  124. ProfileIntegerInstructions,
  125. Profile2Issue,
  126. Profile3Issue,
  127. Profile4Issue,
  128. ProfileSpecialInstructions,
  129. ProfileTotalCycles,
  130. ProfileIcacheIssues,
  131. ProfileDcacheAccesses,
  132. ProfileMemoryBarrierCycles,
  133. ProfileLoadLinkedIssues,
  134. ProfileMaximum
  135. } KPROFILE_SOURCE;
  136. // end_ntddk end_wdm end_ntifs end_nthal
  137. //
  138. // User mode callback return.
  139. //
  140. NTSYSCALLAPI
  141. NTSTATUS
  142. NTAPI
  143. NtCallbackReturn (
  144. IN PVOID OutputBuffer OPTIONAL,
  145. IN ULONG OutputLength,
  146. IN NTSTATUS Status
  147. );
  148. NTSYSCALLAPI
  149. NTSTATUS
  150. NTAPI
  151. NtQueryDebugFilterState (
  152. IN ULONG ComponentId,
  153. IN ULONG Level
  154. );
  155. NTSYSCALLAPI
  156. NTSTATUS
  157. NTAPI
  158. NtSetDebugFilterState (
  159. IN ULONG ComponentId,
  160. IN ULONG Level,
  161. IN BOOLEAN State
  162. );
  163. NTSYSAPI
  164. NTSTATUS
  165. NTAPI
  166. NtW32Call (
  167. IN ULONG ApiNumber,
  168. IN PVOID InputBuffer,
  169. IN ULONG InputLength,
  170. OUT PVOID *OutputBuffer,
  171. OUT PULONG OutputLength
  172. );
  173. NTSYSCALLAPI
  174. NTSTATUS
  175. NTAPI
  176. NtYieldExecution (
  177. VOID
  178. );
  179. #ifdef __cplusplus
  180. }
  181. #endif
  182. #endif // _NTKEAPI_