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.

225 lines
4.9 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. LockQueueUnusedSpare1,
  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. LockQueueMmNonPagedPoolLock,
  88. LockQueueMaximumLock
  89. } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
  90. typedef struct _KSPIN_LOCK_QUEUE {
  91. struct _KSPIN_LOCK_QUEUE * volatile Next;
  92. PKSPIN_LOCK volatile Lock;
  93. } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
  94. typedef struct _KLOCK_QUEUE_HANDLE {
  95. KSPIN_LOCK_QUEUE LockQueue;
  96. KIRQL OldIrql;
  97. } KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
  98. // begin_wdm
  99. //
  100. // Interrupt routine (first level dispatch)
  101. //
  102. typedef
  103. VOID
  104. (*PKINTERRUPT_ROUTINE) (
  105. VOID
  106. );
  107. //
  108. // Profile source types
  109. //
  110. typedef enum _KPROFILE_SOURCE {
  111. ProfileTime,
  112. ProfileAlignmentFixup,
  113. ProfileTotalIssues,
  114. ProfilePipelineDry,
  115. ProfileLoadInstructions,
  116. ProfilePipelineFrozen,
  117. ProfileBranchInstructions,
  118. ProfileTotalNonissues,
  119. ProfileDcacheMisses,
  120. ProfileIcacheMisses,
  121. ProfileCacheMisses,
  122. ProfileBranchMispredictions,
  123. ProfileStoreInstructions,
  124. ProfileFpInstructions,
  125. ProfileIntegerInstructions,
  126. Profile2Issue,
  127. Profile3Issue,
  128. Profile4Issue,
  129. ProfileSpecialInstructions,
  130. ProfileTotalCycles,
  131. ProfileIcacheIssues,
  132. ProfileDcacheAccesses,
  133. ProfileMemoryBarrierCycles,
  134. ProfileLoadLinkedIssues,
  135. ProfileMaximum
  136. } KPROFILE_SOURCE;
  137. // end_ntddk end_wdm end_ntifs end_nthal
  138. //
  139. // User mode callback return.
  140. //
  141. NTSYSCALLAPI
  142. NTSTATUS
  143. NTAPI
  144. NtCallbackReturn (
  145. IN PVOID OutputBuffer OPTIONAL,
  146. IN ULONG OutputLength,
  147. IN NTSTATUS Status
  148. );
  149. NTSYSCALLAPI
  150. NTSTATUS
  151. NTAPI
  152. NtQueryDebugFilterState (
  153. IN ULONG ComponentId,
  154. IN ULONG Level
  155. );
  156. NTSYSCALLAPI
  157. NTSTATUS
  158. NTAPI
  159. NtSetDebugFilterState (
  160. IN ULONG ComponentId,
  161. IN ULONG Level,
  162. IN BOOLEAN State
  163. );
  164. NTSYSAPI
  165. NTSTATUS
  166. NTAPI
  167. NtW32Call (
  168. IN ULONG ApiNumber,
  169. IN PVOID InputBuffer,
  170. IN ULONG InputLength,
  171. OUT PVOID *OutputBuffer,
  172. OUT PULONG OutputLength
  173. );
  174. NTSYSCALLAPI
  175. NTSTATUS
  176. NTAPI
  177. NtYieldExecution (
  178. VOID
  179. );
  180. #ifdef __cplusplus
  181. }
  182. #endif
  183. #endif // _NTKEAPI_