1 /* KERNEL TYPES **************************************************************/
3 #ifndef __INCLUDE_DDK_KETYPES_H
4 #define __INCLUDE_DDK_KETYPES_H
6 typedef LONG KPRIORITY
;
8 typedef VOID (*PKBUGCHECK_CALLBACK_ROUTINE
)(PVOID Buffer
, ULONG Length
);
9 typedef BOOLEAN (*PKSYNCHRONIZE_ROUTINE
)(PVOID SynchronizeContext
);
13 typedef VOID (*PKNORMAL_ROUTINE
)(PVOID NormalContext
,
14 PVOID SystemArgument1
,
15 PVOID SystemArgument2
);
16 typedef VOID (*PKKERNEL_ROUTINE
)(struct _KAPC
* Apc
,
17 PKNORMAL_ROUTINE
* NormalRoutine
,
19 PVOID
* SystemArgument1
,
20 PVOID
* SystemArgument2
);
22 typedef VOID (*PKRUNDOWN_ROUTINE
)(struct _KAPC
* Apc
);
26 * PURPOSE: Object describing the wait a thread is currently performing
29 LIST_ENTRY WaitListEntry
;
30 struct _KTHREAD
* Thread
;
32 struct _KWAIT_BLOCK
* NextWaitBlock
;
35 } KWAIT_BLOCK
, *PKWAIT_BLOCK
;
37 #define _KTHREAD _ETHREAD
39 typedef struct _ETHREAD
41 * PURPOSE: Describes a thread of execution
48 * PURPOSE: Head of the queue of apcs
50 LIST_ENTRY ApcQueueHead
;
53 * PURPOSE: Entry in the linked list of threads
58 * PURPOSE: Current state of the thread
63 * PURPOSE: Priority modifier of the thread
68 * PURPOSE: Pointer to our process
70 struct _EPROCESS
* Process
;
73 * PURPOSE: Handle of our process
78 * PURPOSE: Thread affinity mask
83 * PURPOSE: Saved thread context
85 hal_thread_state context
;
87 } KTHREAD
, *PKTHREAD
, *PETHREAD
;
89 typedef struct _DISPATCHER_HEADER
96 LIST_ENTRY WaitListHead
;
104 struct _KTHREAD
* Thread
;
105 LIST_ENTRY ApcListEntry
;
106 PKKERNEL_ROUTINE KernelRoutine
;
107 PKRUNDOWN_ROUTINE RundownRoutine
;
108 PKNORMAL_ROUTINE NormalRoutine
;
110 PVOID SystemArgument1
;
111 PVOID SystemArgument2
;
113 KPROCESSOR_MODE ApcMode
;
120 PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine
;
126 } KBUGCHECK_CALLBACK_RECORD
, *PKBUGCHECK_CALLBACK_RECORD
;
130 DISPATCHER_HEADER Header
;
131 LIST_ENTRY MutantListEntry
;
132 struct _KTHREAD
* OwnerThread
;
139 DISPATCHER_HEADER Header
;
141 } KSEMAPHORE
, *PKSEMAPHORE
;
143 typedef struct _KEVENT
145 * PURPOSE: Describes an event
149 * PURPOSE: So we can use the general wait routine
151 DISPATCHER_HEADER Header
;
155 typedef struct _KSPIN_LOCK
158 } KSPIN_LOCK
, *PKSPIN_LOCK
;
160 typedef VOID (*PDRIVER_ADD_DEVICE
)(VOID
);
165 * PURPOSE: Defines a delayed procedure call routine
167 * Dpc = The associated DPC object
168 * DeferredContext = Driver defined context for the DPC
169 * SystemArgument[1-2] = Undocumented.
172 typedef VOID (*PKDEFERRED_ROUTINE
)(struct _KDPC
* Dpc
, PVOID DeferredContext
,
173 PVOID SystemArgument1
, PVOID SystemArgument2
);
177 * PURPOSE: Defines a delayed procedure call object
181 * PURPOSE: Magic value to check this is the current object type
186 * PURPOSE: Target processor or zero if untargetted
191 * PURPOSE: Indication of desired latency before exection
195 LIST_ENTRY DpcListEntry
;
196 PKDEFERRED_ROUTINE DeferredRoutine
;
197 PVOID DeferredContext
;
198 PVOID SystemArgument1
;
199 PVOID SystemArgument2
;
202 * PURPOSE: If non-zero then already in queue
209 typedef struct _KDEVICE_QUEUE
214 } KDEVICE_QUEUE
, *PKDEVICE_QUEUE
;
216 typedef struct _KDEVICE_QUEUE_ENTRY
220 } KDEVICE_QUEUE_ENTRY
, *PKDEVICE_QUEUE_ENTRY
;
222 typedef struct _WAIT_CONTEXT_BLOCK
224 } WAIT_CONTEXT_BLOCK
, *PWAIT_CONTEXT_BLOCK
;
227 typedef struct _KTIMER
230 * Pointers to maintain the linked list of activated timers
235 * Absolute expiration time in system time units
237 unsigned long long expire_time
;
240 * Optional dpc associated with the timer
245 * True if the timer is signaled
250 * True if the timer is in the system timer queue
255 * Type of the timer either Notification or Synchronization
260 * Period of the timer in milliseconds (zero if once-only)
268 typedef BOOLEAN (*PKSERVICE_ROUTINE
)(struct _KINTERRUPT
* Interrupt
,
269 PVOID ServiceContext
);
271 typedef struct _KINTERRUPT
274 KAFFINITY ProcessorEnableMask
;
277 BOOLEAN FloatingSave
;
278 PKSERVICE_ROUTINE ServiceRoutine
;
279 PVOID ServiceContext
;
282 } KINTERRUPT
, *PKINTERRUPT
;
284 #endif /* __INCLUDE_DDK_KETYPES_H */