- NDK 0.98, now with versionned headers. Too many changes to list, see the TinyKRNL...
[reactos.git] / reactos / include / ndk / ketypes.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 lpctypes.h
8
9 Abstract:
10
11 Type definitions for the Loader.
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _KETYPES_H
20 #define _KETYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #ifndef NTOS_MODE_USER
27 #include <haltypes.h>
28 #include <potypes.h>
29 #include <ifssupp.h>
30 #endif
31
32 //
33 // Context Record Flags
34 //
35 #define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
36
37 //
38 // Maximum System Descriptor Table Entries
39 //
40 #define SSDT_MAX_ENTRIES 2
41
42 //
43 // Dispatcher Priority increments
44 //
45 #define THREAD_ALERT_INCREMENT 2
46
47 //
48 // User Shared Data in Kernel-Mode
49 //
50 #define KI_USER_SHARED_DATA 0xffdf0000
51
52 //
53 // Physical memory offset of KUSER_SHARED_DATA
54 //
55 #define KI_USER_SHARED_DATA_PHYSICAL 0x41000
56
57 //
58 // Kernel Feature Bits
59 //
60 #define KF_RDTSC 0x00000002
61
62 //
63 // KPCR Access for non-IA64 builds
64 //
65 #define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS))
66 #define PCR ((volatile KPCR * const)K0IPCR)
67 #define KeGetPcr() PCR
68
69 //
70 // Number of dispatch codes supported by KINTERRUPT
71 //
72 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
73 #define KINTERRUPT_DISPATCH_CODES 135
74 #else
75 #define KINTERRUPT_DISPATCH_CODES 106
76 #endif
77
78 #ifdef NTOS_MODE_USER
79
80 //
81 // KPROCESSOR_MODE Type
82 //
83 typedef CCHAR KPROCESSOR_MODE;
84
85 //
86 // Dereferencable pointer to KUSER_SHARED_DATA in User-Mode
87 //
88 #define SharedUserData ((KUSER_SHARED_DATA *CONST)USER_SHARED_DATA)
89
90 //
91 // Maximum WOW64 Entries in KUSER_SHARED_DATA
92 //
93 #define MAX_WOW64_SHARED_ENTRIES 16
94
95 //
96 // Maximum Processor Features supported in KUSER_SHARED_DATA
97 //
98 #define PROCESSOR_FEATURE_MAX 64
99
100 //
101 // Event Types
102 //
103 typedef enum _EVENT_TYPE
104 {
105 NotificationEvent,
106 SynchronizationEvent
107 } EVENT_TYPE;
108
109 //
110 // Timer Types
111 //
112 typedef enum _TIMER_TYPE
113 {
114 NotificationTimer,
115 SynchronizationTimer
116 } TIMER_TYPE;
117
118 //
119 // Wait Types
120 //
121 typedef enum _WAIT_TYPE
122 {
123 WaitAll,
124 WaitAny
125 } WAIT_TYPE;
126
127 //
128 // Processor Execution Modes
129 //
130 typedef enum _MODE
131 {
132 KernelMode,
133 UserMode,
134 MaximumMode
135 } MODE;
136
137 //
138 // Wait Reasons
139 //
140 typedef enum _KWAIT_REASON
141 {
142 Executive,
143 FreePage,
144 PageIn,
145 PoolAllocation,
146 DelayExecution,
147 Suspended,
148 UserRequest,
149 WrExecutive,
150 WrFreePage,
151 WrPageIn,
152 WrPoolAllocation,
153 WrDelayExecution,
154 WrSuspended,
155 WrUserRequest,
156 WrEventPair,
157 WrQueue,
158 WrLpcReceive,
159 WrLpcReply,
160 WrVirtualMemory,
161 WrPageOut,
162 WrRendezvous,
163 Spare2,
164 WrGuardedMutex,
165 Spare4,
166 Spare5,
167 Spare6,
168 WrKernel,
169 WrResource,
170 WrPushLock,
171 WrMutex,
172 WrQuantumEnd,
173 WrDispatchInt,
174 WrPreempted,
175 WrYieldExecution,
176 MaximumWaitReason
177 } KWAIT_REASON;
178
179 //
180 // Profiling Sources
181 //
182 typedef enum _KPROFILE_SOURCE
183 {
184 ProfileTime,
185 ProfileAlignmentFixup,
186 ProfileTotalIssues,
187 ProfilePipelineDry,
188 ProfileLoadInstructions,
189 ProfilePipelineFrozen,
190 ProfileBranchInstructions,
191 ProfileTotalNonissues,
192 ProfileDcacheMisses,
193 ProfileIcacheMisses,
194 ProfileCacheMisses,
195 ProfileBranchMispredictions,
196 ProfileStoreInstructions,
197 ProfileFpInstructions,
198 ProfileIntegerInstructions,
199 Profile2Issue,
200 Profile3Issue,
201 Profile4Issue,
202 ProfileSpecialInstructions,
203 ProfileTotalCycles,
204 ProfileIcacheIssues,
205 ProfileDcacheAccesses,
206 ProfileMemoryBarrierCycles,
207 ProfileLoadLinkedIssues,
208 ProfileMaximum
209 } KPROFILE_SOURCE;
210
211 //
212 // NT Product and Architecture Types
213 //
214 typedef enum _NT_PRODUCT_TYPE
215 {
216 NtProductWinNt = 1,
217 NtProductLanManNt,
218 NtProductServer
219 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
220
221 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
222 {
223 StandardDesign,
224 NEC98x86,
225 EndAlternatives
226 } ALTERNATIVE_ARCHITECTURE_TYPE;
227
228 #endif
229
230 //
231 // Thread States
232 //
233 typedef enum _KTHREAD_STATE
234 {
235 Initialized,
236 Ready,
237 Running,
238 Standby,
239 Terminated,
240 Waiting,
241 Transition,
242 DeferredReady,
243 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
244 GateWait,
245 #endif
246 } KTHREAD_STATE, *PKTHREAD_STATE;
247
248 //
249 // Process States
250 //
251 typedef enum _KPROCESS_STATE
252 {
253 ProcessInMemory,
254 ProcessOutOfMemory,
255 ProcessInTransition,
256 ProcessInSwap,
257 ProcessOutSwap,
258 } KPROCESS_STATE, *PKPROCESS_STATE;
259
260 //
261 // NtVdmControl Classes
262 //
263 typedef enum _VDMSERVICECLASS
264 {
265 VdmStartExecution = 0,
266 VdmQueueInterrupt = 1,
267 VdmDelayInterrupt = 2,
268 VdmInitialize = 3,
269 VdmFeatures = 4,
270 VdmSetInt21Handler = 5,
271 VdmQueryDir = 6,
272 VdmPrinterDirectIoOpen = 7,
273 VdmPrinterDirectIoClose = 8,
274 VdmPrinterInitialize = 9,
275 VdmSetLdtEntries = 10,
276 VdmSetProcessLdtInfo = 11,
277 VdmAdlibEmulation = 12,
278 VdmPMCliControl = 13,
279 VdmQueryVdmProcess = 14,
280 } VDMSERVICECLASS;
281
282 #ifdef NTOS_MODE_USER
283
284 //
285 // APC Normal Routine
286 //
287 typedef VOID
288 (NTAPI *PKNORMAL_ROUTINE)(
289 IN PVOID NormalContext,
290 IN PVOID SystemArgument1,
291 IN PVOID SystemArgument2
292 );
293
294 //
295 // Timer Routine
296 //
297 typedef VOID
298 (NTAPI *PTIMER_APC_ROUTINE)(
299 IN PVOID TimerContext,
300 IN ULONG TimerLowValue,
301 IN LONG TimerHighValue
302 );
303
304 //
305 // System Time Structure
306 //
307 typedef struct _KSYSTEM_TIME
308 {
309 ULONG LowPart;
310 LONG High1Time;
311 LONG High2Time;
312 } KSYSTEM_TIME, *PKSYSTEM_TIME;
313
314 //
315 // Shared Kernel User Data
316 //
317 typedef struct _KUSER_SHARED_DATA
318 {
319 ULONG TickCountLowDeprecated;
320 ULONG TickCountMultiplier;
321 volatile KSYSTEM_TIME InterruptTime;
322 volatile KSYSTEM_TIME SystemTime;
323 volatile KSYSTEM_TIME TimeZoneBias;
324 USHORT ImageNumberLow;
325 USHORT ImageNumberHigh;
326 WCHAR NtSystemRoot[260];
327 ULONG MaxStackTraceDepth;
328 ULONG CryptoExponent;
329 ULONG TimeZoneId;
330 ULONG LargePageMinimum;
331 ULONG Reserved2[7];
332 NT_PRODUCT_TYPE NtProductType;
333 BOOLEAN ProductTypeIsValid;
334 ULONG NtMajorVersion;
335 ULONG NtMinorVersion;
336 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
337 ULONG Reserved1;
338 ULONG Reserved3;
339 volatile ULONG TimeSlip;
340 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
341 LARGE_INTEGER SystemExpirationDate;
342 ULONG SuiteMask;
343 BOOLEAN KdDebuggerEnabled;
344 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
345 UCHAR NXSupportPolicy;
346 #endif
347 volatile ULONG ActiveConsoleId;
348 volatile ULONG DismountCount;
349 ULONG ComPlusPackage;
350 ULONG LastSystemRITEventTickCount;
351 ULONG NumberOfPhysicalPages;
352 BOOLEAN SafeBootMode;
353 ULONG TraceLogging;
354 ULONG Fill0;
355 ULONGLONG TestRetInstruction;
356 ULONG SystemCall;
357 ULONG SystemCallReturn;
358 ULONGLONG SystemCallPad[3];
359 union {
360 volatile KSYSTEM_TIME TickCount;
361 volatile ULONG64 TickCountQuad;
362 };
363 ULONG Cookie;
364 #if (NTDDI_VERSION >= NTDDI_WS03)
365 LONGLONG ConsoleSessionForegroundProcessId;
366 ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
367 #endif
368 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
369 USHORT UserModeGlobalLogger[8];
370 ULONG HeapTracingPid[2];
371 ULONG CritSecTracingPid[2];
372 union
373 {
374 ULONG SharedDataFlags;
375 struct
376 {
377 ULONG DbgErrorPortPresent:1;
378 ULONG DbgElevationEnabled:1;
379 ULONG DbgVirtEnabled:1;
380 ULONG DbgInstallerDetectEnabled:1;
381 ULONG SpareBits:28;
382 };
383 };
384 ULONG ImageFileExecutionOptions;
385 KAFFINITY ActiveProcessorAffinity;
386 #endif
387 } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
388
389 //
390 // VDM Structures
391 //
392 #include "pshpack1.h"
393 typedef struct _VdmVirtualIca
394 {
395 LONG ica_count[8];
396 LONG ica_int_line;
397 LONG ica_cpu_int;
398 USHORT ica_base;
399 USHORT ica_hipiri;
400 USHORT ica_mode;
401 UCHAR ica_master;
402 UCHAR ica_irr;
403 UCHAR ica_isr;
404 UCHAR ica_imr;
405 UCHAR ica_ssr;
406 } VDMVIRTUALICA, *PVDMVIRTUALICA;
407 #include "poppack.h"
408
409 typedef struct _VdmIcaUserData
410 {
411 PVOID pIcaLock;
412 PVDMVIRTUALICA pIcaMaster;
413 PVDMVIRTUALICA pIcaSlave;
414 PULONG pDelayIrq;
415 PULONG pUndelayIrq;
416 PULONG pDelayIret;
417 PULONG pIretHooked;
418 PULONG pAddrIretBopTable;
419 PHANDLE phWowIdleEvent;
420 PLARGE_INTEGER pIcaTimeout;
421 PHANDLE phMainThreadSuspended;
422 } VDMICAUSERDATA, *PVDMICAUSERDATA;
423
424 typedef struct _VDM_INITIALIZE_DATA
425 {
426 PVOID TrapcHandler;
427 PVDMICAUSERDATA IcaUserData;
428 } VDM_INITIALIZE_DATA, *PVDM_INITIALIZE_DATA;
429
430 #else
431
432 //
433 // System Thread Start Routine
434 //
435 typedef
436 VOID
437 (NTAPI *PKSYSTEM_ROUTINE)(
438 PKSTART_ROUTINE StartRoutine,
439 PVOID StartContext
440 );
441
442 //
443 // APC Environment Types
444 //
445 typedef enum _KAPC_ENVIRONMENT
446 {
447 OriginalApcEnvironment,
448 AttachedApcEnvironment,
449 CurrentApcEnvironment
450 } KAPC_ENVIRONMENT;
451
452 //
453 // CPU Cache Types
454 //
455 typedef enum _PROCESSOR_CACHE_TYPE
456 {
457 CacheUnified,
458 CacheInstruction,
459 CacheData,
460 CacheTrace,
461 } PROCESSOR_CACHE_TYPE;
462
463 //
464 // PRCB DPC Data
465 //
466 typedef struct _KDPC_DATA
467 {
468 LIST_ENTRY DpcListHead;
469 ULONG DpcLock;
470 ULONG DpcQueueDepth;
471 ULONG DpcCount;
472 } KDPC_DATA, *PKDPC_DATA;
473
474 //
475 // Per-Processor Lookaside List
476 //
477 typedef struct _PP_LOOKASIDE_LIST
478 {
479 struct _GENERAL_LOOKASIDE *P;
480 struct _GENERAL_LOOKASIDE *L;
481 } PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST;
482
483 //
484 // CPU Cache Descriptor
485 //
486 typedef struct _CACHE_DESCRIPTOR
487 {
488 UCHAR Level;
489 UCHAR Associativity;
490 USHORT LineSize;
491 ULONG Size;
492 PROCESSOR_CACHE_TYPE Type;
493 } CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR;
494
495 //
496 // Architectural Types
497 //
498 #include <arch/ketypes.h>
499
500 //
501 // Kernel Memory Node
502 //
503 #include <pshpack1.h>
504 typedef struct _KNODE
505 {
506 SLIST_HEADER DeadStackList;
507 SLIST_HEADER PfnDereferenceSListHead;
508 KAFFINITY ProcessorMask;
509 ULONG Color;
510 UCHAR Seed;
511 UCHAR NodeNumber;
512 ULONG Flags;
513 ULONG MmShiftedColor;
514 ULONG FreeCount[2];
515 struct _SINGLE_LIST_ENTRY *PfnDeferredList;
516 } KNODE, *PKNODE;
517 #include <poppack.h>
518
519 //
520 // Kernel Profile Object
521 //
522 typedef struct _KPROFILE
523 {
524 CSHORT Type;
525 CSHORT Size;
526 LIST_ENTRY ProfileListEntry;
527 struct _KPROCESS *Process;
528 PVOID RangeBase;
529 PVOID RangeLimit;
530 ULONG BucketShift;
531 PVOID Buffer;
532 ULONG Segment;
533 KAFFINITY Affinity;
534 KPROFILE_SOURCE Source;
535 BOOLEAN Started;
536 } KPROFILE, *PKPROFILE;
537
538 //
539 // Kernel Interrupt Object
540 //
541 typedef struct _KINTERRUPT
542 {
543 CSHORT Type;
544 CSHORT Size;
545 LIST_ENTRY InterruptListEntry;
546 PKSERVICE_ROUTINE ServiceRoutine;
547 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
548 PKSERVICE_ROUTINE MessageServiceRoutine;
549 ULONG MessageIndex;
550 #endif
551 PVOID ServiceContext;
552 KSPIN_LOCK SpinLock;
553 ULONG TickCount;
554 PKSPIN_LOCK ActualLock;
555 PVOID DispatchAddress;
556 ULONG Vector;
557 KIRQL Irql;
558 KIRQL SynchronizeIrql;
559 BOOLEAN FloatingSave;
560 BOOLEAN Connected;
561 CHAR Number;
562 UCHAR ShareVector;
563 KINTERRUPT_MODE Mode;
564 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
565 KINTERRUPT_POLARITY Polarity;
566 #endif
567 ULONG ServiceCount;
568 ULONG DispatchCount;
569 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
570 ULONGLONG Rsvd1;
571 #endif
572 ULONG DispatchCode[KINTERRUPT_DISPATCH_CODES];
573 } KINTERRUPT, *PKINTERRUPT;
574
575 //
576 // Kernel Event Pair Object
577 //
578 typedef struct _KEVENT_PAIR
579 {
580 CSHORT Type;
581 CSHORT Size;
582 KEVENT LowEvent;
583 KEVENT HighEvent;
584 } KEVENT_PAIR, *PKEVENT_PAIR;
585
586 //
587 // Kernel No Execute Options
588 //
589 typedef struct _KEXECUTE_OPTIONS
590 {
591 UCHAR ExecuteDisable:1;
592 UCHAR ExecuteEnable:1;
593 UCHAR DisableThunkEmulation:1;
594 UCHAR Permanent:1;
595 UCHAR ExecuteDispatchEnable:1;
596 UCHAR ImageDispatchEnable:1;
597 UCHAR Spare:2;
598 } KEXECUTE_OPTIONS, *PKEXECUTE_OPTIONS;
599
600 //
601 // Kernel Object Types
602 //
603 typedef enum _KOBJECTS
604 {
605 EventNotificationObject = 0,
606 EventSynchronizationObject = 1,
607 MutantObject = 2,
608 ProcessObject = 3,
609 QueueObject = 4,
610 SemaphoreObject = 5,
611 ThreadObject = 6,
612 GateObject = 7,
613 TimerNotificationObject = 8,
614 TimerSynchronizationObject = 9,
615 Spare2Object = 10,
616 Spare3Object = 11,
617 Spare4Object = 12,
618 Spare5Object = 13,
619 Spare6Object = 14,
620 Spare7Object = 15,
621 Spare8Object = 16,
622 Spare9Object = 17,
623 ApcObject = 18,
624 DpcObject = 19,
625 DeviceQueueObject = 20,
626 EventPairObject = 21,
627 InterruptObject = 22,
628 ProfileObject = 23,
629 ThreadedDpcObject = 24,
630 MaximumKernelObject = 25
631 } KOBJECTS;
632
633 //
634 // Kernel Thread (KTHREAD)
635 //
636 #include <pshpack1.h>
637 typedef struct _KTHREAD
638 {
639 DISPATCHER_HEADER DispatcherHeader;
640 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
641 ULONGLONG CycleTime;
642 ULONG HighCycleTime;
643 #else
644 LIST_ENTRY MutantListHead;
645 #endif
646 PVOID InitialStack;
647 ULONG_PTR StackLimit;
648 PVOID KernelStack;
649 KSPIN_LOCK ThreadLock;
650 union
651 {
652 KAPC_STATE ApcState;
653 struct
654 {
655 UCHAR ApcStateFill[23];
656 UCHAR ApcQueueable;
657 };
658 };
659 UCHAR NextProcessor;
660 UCHAR DeferredProcessor;
661 UCHAR AdjustReason;
662 UCHAR AdjustIncrement;
663 KSPIN_LOCK ApcQueueLock;
664 ULONG ContextSwitches;
665 UCHAR State;
666 UCHAR NpxState;
667 UCHAR WaitIrql;
668 UCHAR WaitMode;
669 LONG WaitStatus;
670 union
671 {
672 PKWAIT_BLOCK WaitBlockList;
673 PKGATE GateObject;
674 };
675 UCHAR Alertable;
676 UCHAR WaitNext;
677 UCHAR WaitReason;
678 UCHAR Priority;
679 UCHAR EnableStackSwap;
680 UCHAR SwapBusy;
681 UCHAR Alerted[2];
682 union
683 {
684 LIST_ENTRY WaitListEntry;
685 SINGLE_LIST_ENTRY SwapListEntry;
686 };
687 PKQUEUE Queue;
688 ULONG WaitTime;
689 union
690 {
691 struct
692 {
693 USHORT KernelApcDisable;
694 USHORT SpecialApcDisable;
695 };
696 ULONG CombinedApcDisable;
697 };
698 struct _TEB *Teb;
699 union
700 {
701 KTIMER Timer;
702 UCHAR TimerFill[40];
703 };
704 union
705 {
706 struct
707 {
708 LONG AutoAlignment:1;
709 LONG DisableBoost:1;
710 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
711 LONG EtwStackTrace1ApcInserted:1;
712 LONG EtwStackTrace2ApcInserted:1;
713 LONG CycleChargePending:1;
714 LONG ReservedFlags:27;
715 #else
716 LONG ReservedFlags:30;
717 #endif
718 };
719 LONG ThreadFlags;
720 };
721 PVOID Padding;
722 union
723 {
724 KWAIT_BLOCK WaitBlock[4];
725 union
726 {
727 struct
728 {
729 UCHAR WaitBlockFill0[23];
730 UCHAR SystemAffinityActive;
731 };
732 struct
733 {
734 UCHAR WaitBlockFill1[47];
735 UCHAR PreviousMode;
736 };
737 struct
738 {
739 UCHAR WaitBlockFill2[71];
740 UCHAR ResourceIndex;
741 };
742 struct
743 {
744 UCHAR WaitBlockFill3[95];
745 UCHAR LargeStack;
746 };
747 };
748 };
749 LIST_ENTRY QueueListEntry;
750 PKTRAP_FRAME TrapFrame;
751 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
752 PVOID FirstArgument;
753 #endif
754 PVOID CallbackStack;
755 PVOID ServiceTable;
756 UCHAR ApcStateIndex;
757 UCHAR IdealProcessor;
758 UCHAR Preempted;
759 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
760 UCHAR CalloutActive;
761 #else
762 UCHAR ProcessReadyQueue;
763 #endif
764 UCHAR KernelStackResident;
765 CHAR BasePriority;
766 CHAR PriorityDecrement;
767 CHAR Saturation;
768 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
769 ULONG SystemCallNumber;
770 union
771 {
772 struct
773 {
774 ULONG Reserved0:1;
775 ULONG ReadyTransition:1;
776 ULONG ProcessReadyQueue:1;
777 ULONG Reserved2:1;
778 ULONG Reserved3:28;
779 };
780 LONG MiscFlags;
781 };
782 #endif
783 KAFFINITY UserAffinity;
784 struct _KPROCESS *Process;
785 KAFFINITY Affinity;
786 PKAPC_STATE ApcStatePointer[2];
787 union
788 {
789 KAPC_STATE SavedApcState;
790 union
791 {
792 UCHAR SavedApcStateFill[23];
793 CHAR FreezeCount;
794 };
795 };
796 CHAR SuspendCount;
797 UCHAR UserIdealProcessor;
798 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
799 union
800 {
801 struct
802 {
803 UCHAR ReservedBits0:1;
804 UCHAR SegmentsPresent:1;
805 UCHAR Reservedbits1:1;
806 };
807 UCHAR NestedStateFlags;
808 };
809 #else
810 UCHAR CalloutActive;
811 #endif
812 UCHAR Iopl;
813 PVOID Win32Thread;
814 PVOID StackBase;
815 union
816 {
817 KAPC SuspendApc;
818 struct
819 {
820 UCHAR SuspendApcFill0[1];
821 CHAR Quantum;
822 };
823 struct
824 {
825 UCHAR SuspendApcFill1[3];
826 UCHAR QuantumReset;
827 };
828 struct
829 {
830 UCHAR SuspendApcFill2[4];
831 ULONG KernelTime;
832 };
833 struct
834 {
835 UCHAR SuspendApcFill3[36];
836 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
837 PKPRCB WaitPrcb;
838 #else
839 PVOID TlsArray;
840 #endif
841 };
842 struct
843 {
844 UCHAR SuspendApcFill4[40];
845 PVOID LegoData;
846 };
847 struct
848 {
849 UCHAR SuspendApcFill5[47];
850 UCHAR PowerState;
851 };
852 };
853 ULONG UserTime;
854 union
855 {
856 KSEMAPHORE SuspendSemaphore;
857 UCHAR SuspendSemaphorefill[20];
858 };
859 ULONG SListFaultCount;
860 LIST_ENTRY ThreadListEntry;
861 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
862 LIST_ENTRY MutantListHead;
863 #endif
864 PVOID SListFaultAddress;
865 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
866 PVOID MdlForLockedteb;
867 #endif
868 } KTHREAD;
869 #include <poppack.h>
870
871 //
872 // Kernel Process (KPROCESS)
873 //
874 typedef struct _KPROCESS
875 {
876 DISPATCHER_HEADER Header;
877 LIST_ENTRY ProfileListHead;
878 PHYSICAL_ADDRESS DirectoryTableBase;
879 #if defined(_M_IX86)
880 KGDTENTRY LdtDescriptor;
881 KIDTENTRY Int21Descriptor;
882 USHORT IopmOffset;
883 UCHAR Iopl;
884 UCHAR Unused;
885 #endif
886 ULONG ActiveProcessors;
887 ULONG KernelTime;
888 ULONG UserTime;
889 LIST_ENTRY ReadyListHead;
890 SINGLE_LIST_ENTRY SwapListEntry;
891 PVOID VdmTrapcHandler;
892 LIST_ENTRY ThreadListHead;
893 KSPIN_LOCK ProcessLock;
894 KAFFINITY Affinity;
895 union
896 {
897 struct
898 {
899 ULONG AutoAlignment:1;
900 ULONG DisableBoost:1;
901 ULONG DisableQuantum:1;
902 ULONG ReservedFlags:29;
903 };
904 ULONG ProcessFlags;
905 };
906 CHAR BasePriority;
907 CHAR QuantumReset;
908 UCHAR State;
909 UCHAR ThreadSeed;
910 UCHAR PowerState;
911 UCHAR IdealNode;
912 UCHAR Visited;
913 union
914 {
915 KEXECUTE_OPTIONS Flags;
916 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
917 UCHAR ExecuteOptions;
918 #endif
919 };
920 ULONG StackCount;
921 LIST_ENTRY ProcessListEntry;
922 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
923 ULONGLONG CycleTime;
924 #endif
925 } KPROCESS, *PKPROCESS;
926
927 //
928 // System Service Table Descriptor
929 //
930 typedef struct _KSERVICE_TABLE_DESCRIPTOR
931 {
932 PULONG_PTR Base;
933 PULONG Count;
934 ULONG Limit;
935 #if defined(_IA64_)
936 LONG TableBaseGpOffset;
937 #endif
938 PUCHAR Number;
939 } KSERVICE_TABLE_DESCRIPTOR, *PKSERVICE_TABLE_DESCRIPTOR;
940
941 //
942 // Exported Loader Parameter Block
943 //
944 #ifndef _REACTOS_
945 extern struct _LOADER_PARAMETER_BLOCK NTSYSAPI *KeLoaderBlock;
946 #else
947 extern struct _ROS_LOADER_PARAMETER_BLOCK NTSYSAPI KeLoaderBlock;
948 #endif
949
950 //
951 // Exported Hardware Data
952 //
953 extern KAFFINITY NTSYSAPI KeActiveProcessors;
954 extern CHAR NTSYSAPI KeNumberProcessors;
955 extern ULONG NTSYSAPI KiDmaIoCoherency;
956 extern ULONG NTSYSAPI KeMaximumIncrement;
957 extern ULONG NTSYSAPI KeMinimumIncrement;
958 extern ULONG NTSYSAPI KeDcacheFlushCount;
959 extern ULONG NTSYSAPI KeIcacheFlushCount;
960
961 //
962 // Exported System Service Descriptor Tables
963 //
964 extern KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES];
965 extern KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES];
966
967 #endif // !NTOS_MODE_USER
968
969 #endif // _KETYPES_H