6e1c7d121d1f2a207fecfdbe7e1831252cf70c0e
[reactos.git] / reactos / include / ndk / extypes.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 extypes.h
8
9 Abstract:
10
11 Type definitions for the Executive.
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _EXTYPES_H
20 #define _EXTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <cfg.h>
27 #if defined(_MSC_VER) && !defined(NTOS_MODE_USER)
28 #include <ntimage.h>
29 #endif
30 #include <cmtypes.h>
31 #include <ketypes.h>
32 #include <potypes.h>
33 #include <lpctypes.h>
34
35 //
36 // Atom and Language IDs
37 //
38 typedef USHORT LANGID, *PLANGID;
39 typedef USHORT RTL_ATOM, *PRTL_ATOM;
40
41 #ifndef NTOS_MODE_USER
42
43 //
44 // Kernel Exported Object Types
45 //
46 extern POBJECT_TYPE NTSYSAPI ExDesktopObjectType;
47 extern POBJECT_TYPE NTSYSAPI ExWindowStationObjectType;
48 extern POBJECT_TYPE NTSYSAPI ExIoCompletionType;
49 extern POBJECT_TYPE NTSYSAPI ExMutantObjectType;
50 extern POBJECT_TYPE NTSYSAPI ExTimerType;
51
52 //
53 // Exported NT Build Number
54 //
55 extern ULONG NTSYSAPI NtBuildNumber;
56
57 //
58 // Invalid Handle Value Constant
59 //
60 #define INVALID_HANDLE_VALUE (HANDLE)-1
61
62 #endif
63
64 //
65 // Increments
66 //
67 #define MUTANT_INCREMENT 1
68
69 //
70 // Callback Object Access Mask
71 //
72 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
73 #define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
74 #define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
75 #define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
76
77 //
78 // Event Object Access Masks
79 //
80 #ifdef NTOS_MODE_USER
81 #define EVENT_QUERY_STATE 0x0001
82
83 //
84 // Semaphore Object Acess Masks
85 //
86 #define SEMAPHORE_QUERY_STATE 0x0001
87 #endif
88
89 //
90 // Event Pair Access Masks
91 //
92 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
93
94 //
95 // Profile Object Access Masks
96 //
97 #define PROFILE_CONTROL 0x0001
98 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
99
100 //
101 // Maximum Parameters for NtRaiseHardError
102 //
103 #define MAXIMUM_HARDERROR_PARAMETERS 4
104
105 //
106 // Pushlock bits
107 //
108 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
109 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
110 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
111 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
112 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
113 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
114 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
115
116 //
117 // Pushlock Wait Block Flags
118 //
119 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
120 #define EX_PUSH_LOCK_FLAGS_WAIT 2
121
122 //
123 // Resource (ERESOURCE) Flags
124 //
125 #define ResourceHasDisabledPriorityBoost 0x08
126
127 //
128 // Shutdown types for NtShutdownSystem
129 //
130 typedef enum _SHUTDOWN_ACTION
131 {
132 ShutdownNoReboot,
133 ShutdownReboot,
134 ShutdownPowerOff
135 } SHUTDOWN_ACTION;
136
137 //
138 // Responses for NtRaiseHardError
139 //
140 typedef enum _HARDERROR_RESPONSE_OPTION
141 {
142 OptionAbortRetryIgnore,
143 OptionOk,
144 OptionOkCancel,
145 OptionRetryCancel,
146 OptionYesNo,
147 OptionYesNoCancel,
148 OptionShutdownSystem
149 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
150
151 typedef enum _HARDERROR_RESPONSE
152 {
153 ResponseReturnToCaller,
154 ResponseNotHandled,
155 ResponseAbort,
156 ResponseCancel,
157 ResponseIgnore,
158 ResponseNo,
159 ResponseOk,
160 ResponseRetry,
161 ResponseYes
162 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
163
164 //
165 // System Information Classes for NtQuerySystemInformation
166 //
167 typedef enum _SYSTEM_INFORMATION_CLASS
168 {
169 SystemBasicInformation,
170 SystemProcessorInformation,
171 SystemPerformanceInformation,
172 SystemTimeOfDayInformation,
173 SystemPathInformation, /// Obsolete: Use KUSER_SHARED_DATA
174 SystemProcessInformation,
175 SystemCallCountInformation,
176 SystemDeviceInformation,
177 SystemProcessorPerformanceInformation,
178 SystemFlagsInformation,
179 SystemCallTimeInformation,
180 SystemModuleInformation,
181 SystemLocksInformation,
182 SystemStackTraceInformation,
183 SystemPagedPoolInformation,
184 SystemNonPagedPoolInformation,
185 SystemHandleInformation,
186 SystemObjectInformation,
187 SystemPageFileInformation,
188 SystemVdmInstemulInformation,
189 SystemVdmBopInformation,
190 SystemFileCacheInformation,
191 SystemPoolTagInformation,
192 SystemInterruptInformation,
193 SystemDpcBehaviorInformation,
194 SystemFullMemoryInformation,
195 SystemLoadGdiDriverInformation,
196 SystemUnloadGdiDriverInformation,
197 SystemTimeAdjustmentInformation,
198 SystemSummaryMemoryInformation,
199 SystemNextEventIdInformation,
200 SystemEventIdsInformation,
201 SystemCrashDumpInformation,
202 SystemExceptionInformation,
203 SystemCrashDumpStateInformation,
204 SystemKernelDebuggerInformation,
205 SystemContextSwitchInformation,
206 SystemRegistryQuotaInformation,
207 SystemExtendServiceTableInformation,
208 SystemPrioritySeperation,
209 SystemPlugPlayBusInformation,
210 SystemDockInformation,
211 SystemPowerInformationNative,
212 SystemProcessorSpeedInformation,
213 SystemCurrentTimeZoneInformation,
214 SystemLookasideInformation,
215 SystemTimeSlipNotification,
216 SystemSessionCreate,
217 SystemSessionDetach,
218 SystemSessionInformation,
219 SystemRangeStartInformation,
220 SystemVerifierInformation,
221 SystemAddVerifier,
222 SystemSessionProcessesInformation,
223 SystemInformationClassMax
224 } SYSTEM_INFORMATION_CLASS;
225
226 //
227 // System Information Classes for NtQueryMutant
228 //
229 typedef enum _MUTANT_INFORMATION_CLASS
230 {
231 MutantBasicInformation
232 } MUTANT_INFORMATION_CLASS;
233
234 //
235 // System Information Classes for NtQueryAtom
236 //
237 typedef enum _ATOM_INFORMATION_CLASS
238 {
239 AtomBasicInformation,
240 AtomTableInformation,
241 } ATOM_INFORMATION_CLASS;
242
243 //
244 // System Information Classes for NtQueryTimer
245 //
246 typedef enum _TIMER_INFORMATION_CLASS
247 {
248 TimerBasicInformation
249 } TIMER_INFORMATION_CLASS;
250
251 //
252 // System Information Classes for NtQuerySemaphore
253 //
254 typedef enum _SEMAPHORE_INFORMATION_CLASS
255 {
256 SemaphoreBasicInformation
257 } SEMAPHORE_INFORMATION_CLASS;
258
259 //
260 // System Information Classes for NtQueryEvent
261 //
262 typedef enum _EVENT_INFORMATION_CLASS
263 {
264 EventBasicInformation
265 } EVENT_INFORMATION_CLASS;
266
267 #ifndef NTOS_MODE_USER
268
269 //
270 // Executive Work Queue Structures
271 //
272 typedef struct _EX_QUEUE_WORKER_INFO
273 {
274 ULONG QueueDisabled:1;
275 ULONG MakeThreadsAsNecessary:1;
276 ULONG WaitMode:1;
277 ULONG WorkerCount:29;
278 } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;
279
280 typedef struct _EX_WORK_QUEUE
281 {
282 KQUEUE WorkerQueue;
283 LONG DynamicThreadCount;
284 ULONG WorkItemsProcessed;
285 ULONG WorkItemsProcessedLastPass;
286 ULONG QueueDepthLastPass;
287 EX_QUEUE_WORKER_INFO Info;
288 } EX_WORK_QUEUE, *PEX_WORK_QUEUE;
289
290 //
291 // Executive Fast Reference Structure
292 //
293 typedef struct _EX_FAST_REF
294 {
295 union
296 {
297 PVOID Object;
298 ULONG RefCnt:3;
299 ULONG Value;
300 };
301 } EX_FAST_REF, *PEX_FAST_REF;
302
303 //
304 // Executive Cache-Aware Rundown Reference Descriptor
305 //
306 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
307 {
308 union
309 {
310 ULONG_PTR Count;
311 PVOID Ptr;
312 };
313 PVOID PoolToFree;
314 } EX_RUNDOWN_REF_CACHE_AWARE, *PEX_RUNDOWN_REF_CACHE_AWARE;
315
316 //
317 // Executive Rundown Wait Block
318 //
319 typedef struct _EX_RUNDOWN_WAIT_BLOCK
320 {
321 ULONG_PTR Count;
322 KEVENT RundownEvent;
323 } EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
324
325 //
326 // Executive Pushlock
327 //
328 #undef EX_PUSH_LOCK
329 #undef PEX_PUSH_LOCK
330 typedef struct _EX_PUSH_LOCK
331 {
332 union
333 {
334 struct
335 {
336 ULONG_PTR Locked:1;
337 ULONG_PTR Waiting:1;
338 ULONG_PTR Waking:1;
339 ULONG_PTR MultipleShared:1;
340 ULONG_PTR Shared:sizeof (ULONG_PTR) * 8 - 4;
341 };
342 ULONG_PTR Value;
343 PVOID Ptr;
344 };
345 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
346
347 //
348 // Executive Pushlock Wait Block
349 //
350 #ifndef __GNUC__ // WARNING! PUSHLOCKS WILL NOT WORK IN GCC FOR NOW!!!
351 __declspec(align(16))
352 #endif
353 typedef struct _EX_PUSH_LOCK_WAIT_BLOCK
354 {
355 union
356 {
357 KGATE WakeGate;
358 KEVENT WakeEvent;
359 };
360 struct _EX_PUSH_LOCK_WAIT_BLOCK *Next;
361 struct _EX_PUSH_LOCK_WAIT_BLOCK *Last;
362 struct _EX_PUSH_LOCK_WAIT_BLOCK *Previous;
363 LONG ShareCount;
364 LONG Flags;
365 #if DBG
366 BOOLEAN Signaled;
367 EX_PUSH_LOCK NewValue;
368 EX_PUSH_LOCK OldValue;
369 PEX_PUSH_LOCK PushLock;
370 #endif
371 } EX_PUSH_LOCK_WAIT_BLOCK, *PEX_PUSH_LOCK_WAIT_BLOCK;
372
373 //
374 // Callback Object
375 //
376 typedef struct _CALLBACK_OBJECT
377 {
378 ULONG Name;
379 KSPIN_LOCK Lock;
380 LIST_ENTRY RegisteredCallbacks;
381 ULONG AllowMultipleCallbacks;
382 } CALLBACK_OBJECT , *PCALLBACK_OBJECT;
383
384 //
385 // Profile OBject
386 //
387 typedef struct _EPROFILE
388 {
389 PEPROCESS Process;
390 PVOID ImageBase;
391 SIZE_T ImageSize;
392 PVOID Buffer;
393 ULONG BufferSize;
394 ULONG BucketSize;
395 PKPROFILE KeProfile;
396 PVOID LockedBuffer;
397 PMDL Mdl;
398 ULONG Segment;
399 KPROFILE_SOURCE ProfileSource;
400 KAFFINITY Affinity;
401 } EPROFILE, *PEPROFILE;
402
403 //
404 // Handle Table Structures
405 //
406 typedef struct _HANDLE_TABLE_ENTRY_INFO
407 {
408 ULONG AuditMask;
409 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
410
411 typedef struct _HANDLE_TABLE_ENTRY
412 {
413 union
414 {
415 PVOID Object;
416 ULONG_PTR ObAttributes;
417 PHANDLE_TABLE_ENTRY_INFO InfoTable;
418 ULONG_PTR Value;
419 } u1;
420 union
421 {
422 ULONG GrantedAccess;
423 USHORT GrantedAccessIndex;
424 LONG NextFreeTableEntry;
425 } u2;
426 } HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
427
428 typedef struct _HANDLE_TABLE
429 {
430 ULONG Flags;
431 LONG HandleCount;
432 PHANDLE_TABLE_ENTRY **Table;
433 PEPROCESS QuotaProcess;
434 HANDLE UniqueProcessId;
435 LONG FirstFreeTableEntry;
436 LONG NextIndexNeedingPool;
437 ERESOURCE HandleTableLock;
438 LIST_ENTRY HandleTableList;
439 KEVENT HandleContentionEvent;
440 } HANDLE_TABLE, *PHANDLE_TABLE;
441
442 #endif
443
444 //
445 // Hard Error LPC Message
446 //
447 typedef struct _HARDERROR_MSG
448 {
449 PORT_MESSAGE h;
450 NTSTATUS Status;
451 LARGE_INTEGER ErrorTime;
452 ULONG ValidResponseOptions;
453 ULONG Response;
454 ULONG NumberOfParameters;
455 ULONG UnicodeStringParameterMask;
456 ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
457 } HARDERROR_MSG, *PHARDERROR_MSG;
458
459 //
460 // Information Structures for NtQueryMutant
461 //
462 typedef struct _MUTANT_BASIC_INFORMATION
463 {
464 LONG CurrentCount;
465 BOOLEAN OwnedByCaller;
466 BOOLEAN AbandonedState;
467 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
468
469 //
470 // Information Structures for NtQueryAtom
471 //
472 typedef struct _ATOM_BASIC_INFORMATION
473 {
474 USHORT UsageCount;
475 USHORT Flags;
476 USHORT NameLength;
477 WCHAR Name[1];
478 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
479
480 typedef struct _ATOM_TABLE_INFORMATION
481 {
482 ULONG NumberOfAtoms;
483 USHORT Atoms[1];
484 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
485
486 //
487 // Information Structures for NtQueryTimer
488 //
489 typedef struct _TIMER_BASIC_INFORMATION
490 {
491 LARGE_INTEGER TimeRemaining;
492 BOOLEAN SignalState;
493 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
494
495 //
496 // Information Structures for NtQuerySemaphore
497 //
498 typedef struct _SEMAPHORE_BASIC_INFORMATION
499 {
500 LONG CurrentCount;
501 LONG MaximumCount;
502 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
503
504 //
505 // Information Structures for NtQueryEvent
506 //
507 typedef struct _EVENT_BASIC_INFORMATION
508 {
509 EVENT_TYPE EventType;
510 LONG EventState;
511 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
512
513 //
514 // Information Structures for NtQuerySystemInformation
515 //
516 typedef struct _SYSTEM_BASIC_INFORMATION
517 {
518 ULONG Reserved;
519 ULONG TimerResolution;
520 ULONG PageSize;
521 ULONG NumberOfPhysicalPages;
522 ULONG LowestPhysicalPageNumber;
523 ULONG HighestPhysicalPageNumber;
524 ULONG AllocationGranularity;
525 ULONG MinimumUserModeAddress;
526 ULONG MaximumUserModeAddress;
527 KAFFINITY ActiveProcessorsAffinityMask;
528 CCHAR NumberOfProcessors;
529 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
530
531 // Class 1
532 typedef struct _SYSTEM_PROCESSOR_INFORMATION
533 {
534 USHORT ProcessorArchitecture;
535 USHORT ProcessorLevel;
536 USHORT ProcessorRevision;
537 USHORT Reserved;
538 ULONG ProcessorFeatureBits;
539 } SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
540
541 // Class 2
542 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
543 {
544 LARGE_INTEGER IdleProcessTime;
545 LARGE_INTEGER IoReadTransferCount;
546 LARGE_INTEGER IoWriteTransferCount;
547 LARGE_INTEGER IoOtherTransferCount;
548 ULONG IoReadOperationCount;
549 ULONG IoWriteOperationCount;
550 ULONG IoOtherOperationCount;
551 ULONG AvailablePages;
552 ULONG CommittedPages;
553 ULONG CommitLimit;
554 ULONG PeakCommitment;
555 ULONG PageFaultCount;
556 ULONG CopyOnWriteCount;
557 ULONG TransitionCount;
558 ULONG CacheTransitionCount;
559 ULONG DemandZeroCount;
560 ULONG PageReadCount;
561 ULONG PageReadIoCount;
562 ULONG CacheReadCount;
563 ULONG CacheIoCount;
564 ULONG DirtyPagesWriteCount;
565 ULONG DirtyWriteIoCount;
566 ULONG MappedPagesWriteCount;
567 ULONG MappedWriteIoCount;
568 ULONG PagedPoolPages;
569 ULONG NonPagedPoolPages;
570 ULONG PagedPoolAllocs;
571 ULONG PagedPoolFrees;
572 ULONG NonPagedPoolAllocs;
573 ULONG NonPagedPoolFrees;
574 ULONG FreeSystemPtes;
575 ULONG ResidentSystemCodePage;
576 ULONG TotalSystemDriverPages;
577 ULONG TotalSystemCodePages;
578 ULONG NonPagedPoolLookasideHits;
579 ULONG PagedPoolLookasideHits;
580 ULONG Spare3Count;
581 ULONG ResidentSystemCachePage;
582 ULONG ResidentPagedPoolPage;
583 ULONG ResidentSystemDriverPage;
584 ULONG CcFastReadNoWait;
585 ULONG CcFastReadWait;
586 ULONG CcFastReadResourceMiss;
587 ULONG CcFastReadNotPossible;
588 ULONG CcFastMdlReadNoWait;
589 ULONG CcFastMdlReadWait;
590 ULONG CcFastMdlReadResourceMiss;
591 ULONG CcFastMdlReadNotPossible;
592 ULONG CcMapDataNoWait;
593 ULONG CcMapDataWait;
594 ULONG CcMapDataNoWaitMiss;
595 ULONG CcMapDataWaitMiss;
596 ULONG CcPinMappedDataCount;
597 ULONG CcPinReadNoWait;
598 ULONG CcPinReadWait;
599 ULONG CcPinReadNoWaitMiss;
600 ULONG CcPinReadWaitMiss;
601 ULONG CcCopyReadNoWait;
602 ULONG CcCopyReadWait;
603 ULONG CcCopyReadNoWaitMiss;
604 ULONG CcCopyReadWaitMiss;
605 ULONG CcMdlReadNoWait;
606 ULONG CcMdlReadWait;
607 ULONG CcMdlReadNoWaitMiss;
608 ULONG CcMdlReadWaitMiss;
609 ULONG CcReadAheadIos;
610 ULONG CcLazyWriteIos;
611 ULONG CcLazyWritePages;
612 ULONG CcDataFlushes;
613 ULONG CcDataPages;
614 ULONG ContextSwitches;
615 ULONG FirstLevelTbFills;
616 ULONG SecondLevelTbFills;
617 ULONG SystemCalls;
618 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
619
620 // Class 3
621 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
622 {
623 LARGE_INTEGER BootTime;
624 LARGE_INTEGER CurrentTime;
625 LARGE_INTEGER TimeZoneBias;
626 ULONG TimeZoneId;
627 ULONG Reserved;
628 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
629
630 // Class 4
631 // This class is obsolete, please use KUSER_SHARED_DATA instead
632
633 // Class 5
634 typedef struct _SYSTEM_THREAD_INFORMATION
635 {
636 LARGE_INTEGER KernelTime;
637 LARGE_INTEGER UserTime;
638 LARGE_INTEGER CreateTime;
639 ULONG WaitTime;
640 PVOID StartAddress;
641 CLIENT_ID ClientId;
642 KPRIORITY Priority;
643 LONG BasePriority;
644 ULONG ContextSwitches;
645 ULONG ThreadState;
646 ULONG WaitReason;
647 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
648
649 typedef struct _SYSTEM_PROCESS_INFORMATION
650 {
651 ULONG NextEntryOffset;
652 ULONG NumberOfThreads;
653 LARGE_INTEGER SpareLi1;
654 LARGE_INTEGER SpareLi2;
655 LARGE_INTEGER SpareLi3;
656 LARGE_INTEGER CreateTime;
657 LARGE_INTEGER UserTime;
658 LARGE_INTEGER KernelTime;
659 UNICODE_STRING ImageName;
660 KPRIORITY BasePriority;
661 HANDLE UniqueProcessId;
662 HANDLE InheritedFromUniqueProcessId;
663 ULONG HandleCount;
664 ULONG SessionId;
665 ULONG PageDirectoryFrame;
666
667 //
668 // This part corresponds to VM_COUNTERS_EX.
669 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
670 //
671 ULONG PeakVirtualSize;
672 ULONG VirtualSize;
673 ULONG PageFaultCount;
674 ULONG PeakWorkingSetSize;
675 ULONG WorkingSetSize;
676 ULONG QuotaPeakPagedPoolUsage;
677 ULONG QuotaPagedPoolUsage;
678 ULONG QuotaPeakNonPagedPoolUsage;
679 ULONG QuotaNonPagedPoolUsage;
680 ULONG PagefileUsage;
681 ULONG PeakPagefileUsage;
682 ULONG PrivateUsage;
683
684 //
685 // This part corresponds to IO_COUNTERS
686 //
687 LARGE_INTEGER ReadOperationCount;
688 LARGE_INTEGER WriteOperationCount;
689 LARGE_INTEGER OtherOperationCount;
690 LARGE_INTEGER ReadTransferCount;
691 LARGE_INTEGER WriteTransferCount;
692 LARGE_INTEGER OtherTransferCount;
693
694 SYSTEM_THREAD_INFORMATION TH[1];
695 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
696
697 // Class 6
698 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
699 {
700 ULONG Length;
701 ULONG NumberOfTables;
702 } SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
703
704 // Class 7
705 typedef struct _SYSTEM_DEVICE_INFORMATION
706 {
707 ULONG NumberOfDisks;
708 ULONG NumberOfFloppies;
709 ULONG NumberOfCdRoms;
710 ULONG NumberOfTapes;
711 ULONG NumberOfSerialPorts;
712 ULONG NumberOfParallelPorts;
713 } SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION;
714
715 // Class 8
716 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
717 {
718 LARGE_INTEGER IdleTime;
719 LARGE_INTEGER KernelTime;
720 LARGE_INTEGER UserTime;
721 LARGE_INTEGER DpcTime;
722 LARGE_INTEGER InterruptTime;
723 ULONG InterruptCount;
724 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
725
726 // Class 9
727 typedef struct _SYSTEM_FLAGS_INFORMATION
728 {
729 ULONG Flags;
730 } SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION;
731
732 // Class 10
733 typedef struct _SYSTEM_CALL_TIME_INFORMATION
734 {
735 ULONG Length;
736 ULONG TotalCalls;
737 LARGE_INTEGER TimeOfCalls[1];
738 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
739
740 // Class 11
741 typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY
742 {
743 ULONG Unknown1;
744 ULONG Unknown2;
745 PVOID Base;
746 ULONG Size;
747 ULONG Flags;
748 USHORT Index;
749 USHORT NameLength;
750 USHORT LoadCount;
751 USHORT PathLength;
752 CHAR ImageName[256];
753 } SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;
754 typedef struct _SYSTEM_MODULE_INFORMATION
755 {
756 ULONG Count;
757 SYSTEM_MODULE_INFORMATION_ENTRY Module[1];
758 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
759
760 // Class 12
761 typedef struct _SYSTEM_RESOURCE_LOCK_ENTRY
762 {
763 ULONG ResourceAddress;
764 ULONG Always1;
765 ULONG Unknown;
766 ULONG ActiveCount;
767 ULONG ContentionCount;
768 ULONG Unused[2];
769 ULONG NumberOfSharedWaiters;
770 ULONG NumberOfExclusiveWaiters;
771 } SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY;
772
773 typedef struct _SYSTEM_RESOURCE_LOCK_INFO
774 {
775 ULONG Count;
776 SYSTEM_RESOURCE_LOCK_ENTRY Lock[1];
777 } SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO;
778
779 // FIXME: Class 13
780 typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY
781 {
782 ULONG Dummy;
783 } SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY;
784
785 typedef struct _SYSTEM_BACKTRACE_INFORMATION
786 {
787 ULONG Unknown[4];
788 ULONG Count;
789 SYSTEM_BACKTRACE_INFORMATION_ENTRY Trace[1];
790 } SYSTEM_BACKTRACE_INFORMATION, *PSYSTEM_BACKTRACE_INFORMATION;
791
792 // Class 14 - 15
793 typedef struct _SYSTEM_POOL_ENTRY
794 {
795 BOOLEAN Allocated;
796 BOOLEAN Spare0;
797 USHORT AllocatorBackTraceIndex;
798 ULONG Size;
799 union
800 {
801 UCHAR Tag[4];
802 ULONG TagUlong;
803 PVOID ProcessChargedQuota;
804 };
805 } SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY;
806
807 typedef struct _SYSTEM_POOL_INFORMATION
808 {
809 ULONG TotalSize;
810 PVOID FirstEntry;
811 USHORT EntryOverhead;
812 BOOLEAN PoolTagPresent;
813 BOOLEAN Spare0;
814 ULONG NumberOfEntries;
815 SYSTEM_POOL_ENTRY Entries[1];
816 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
817
818 // Class 16
819 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
820 {
821 USHORT UniqueProcessId;
822 USHORT CreatorBackTraceIndex;
823 UCHAR ObjectTypeIndex;
824 UCHAR HandleAttributes;
825 USHORT HandleValue;
826 PVOID Object;
827 ULONG GrantedAccess;
828 } SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
829
830 typedef struct _SYSTEM_HANDLE_INFORMATION
831 {
832 ULONG NumberOfHandles;
833 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1];
834 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
835
836 // Class 17
837 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
838 {
839 ULONG NextEntryOffset;
840 ULONG NumberOfObjects;
841 ULONG NumberOfHandles;
842 ULONG TypeIndex;
843 ULONG InvalidAttributes;
844 GENERIC_MAPPING GenericMapping;
845 ULONG ValidAccessMask;
846 ULONG PoolType;
847 BOOLEAN SecurityRequired;
848 BOOLEAN WaitableObject;
849 UNICODE_STRING TypeName;
850 } SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION;
851
852 typedef struct _SYSTEM_OBJECT_INFORMATION
853 {
854 ULONG NextEntryOffset;
855 PVOID Object;
856 HANDLE CreatorUniqueProcess;
857 USHORT CreatorBackTraceIndex;
858 USHORT Flags;
859 LONG PointerCount;
860 LONG HandleCount;
861 ULONG PagedPoolCharge;
862 ULONG NonPagedPoolCharge;
863 HANDLE ExclusiveProcessId;
864 PVOID SecurityDescriptor;
865 OBJECT_NAME_INFORMATION NameInfo;
866 } SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
867
868 // Class 18
869 typedef struct _SYSTEM_PAGEFILE_INFORMATION
870 {
871 ULONG NextEntryOffset;
872 ULONG TotalSize;
873 ULONG TotalInUse;
874 ULONG PeakUsage;
875 UNICODE_STRING PageFileName;
876 } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
877
878 // Class 19
879 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
880 {
881 ULONG SegmentNotPresent;
882 ULONG VdmOpcode0F;
883 ULONG OpcodeESPrefix;
884 ULONG OpcodeCSPrefix;
885 ULONG OpcodeSSPrefix;
886 ULONG OpcodeDSPrefix;
887 ULONG OpcodeFSPrefix;
888 ULONG OpcodeGSPrefix;
889 ULONG OpcodeOPER32Prefix;
890 ULONG OpcodeADDR32Prefix;
891 ULONG OpcodeINSB;
892 ULONG OpcodeINSW;
893 ULONG OpcodeOUTSB;
894 ULONG OpcodeOUTSW;
895 ULONG OpcodePUSHF;
896 ULONG OpcodePOPF;
897 ULONG OpcodeINTnn;
898 ULONG OpcodeINTO;
899 ULONG OpcodeIRET;
900 ULONG OpcodeINBimm;
901 ULONG OpcodeINWimm;
902 ULONG OpcodeOUTBimm;
903 ULONG OpcodeOUTWimm ;
904 ULONG OpcodeINB;
905 ULONG OpcodeINW;
906 ULONG OpcodeOUTB;
907 ULONG OpcodeOUTW;
908 ULONG OpcodeLOCKPrefix;
909 ULONG OpcodeREPNEPrefix;
910 ULONG OpcodeREPPrefix;
911 ULONG OpcodeHLT;
912 ULONG OpcodeCLI;
913 ULONG OpcodeSTI;
914 ULONG BopCount;
915 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
916
917 // FIXME: Class 20
918 typedef struct _SYSTEM_VDM_BOP_INFO
919 {
920 PVOID Dummy;
921 } SYSTEM_VDM_BOP_INFO, *PSYSTEM_VDM_BOP_INFO;
922
923 // Class 21
924 typedef struct _SYSTEM_CACHE_INFORMATION
925 {
926 ULONG CurrentSize;
927 ULONG PeakSize;
928 ULONG PageFaultCount;
929 ULONG MinimumWorkingSet;
930 ULONG MaximumWorkingSet;
931 ULONG CurrentSizeIncludingTransitionInPages;
932 ULONG PeakSizeIncludingTransitionInPages;
933 ULONG Unused[2];
934 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
935
936 // Class 22
937 typedef struct _SYSTEM_POOLTAG
938 {
939 union
940 {
941 UCHAR Tag[4];
942 ULONG TagUlong;
943 };
944 ULONG PagedAllocs;
945 ULONG PagedFrees;
946 ULONG PagedUsed;
947 ULONG NonPagedAllocs;
948 ULONG NonPagedFrees;
949 ULONG NonPagedUsed;
950 } SYSTEM_POOLTAG, *PSYSTEM_POOLTAG;
951 typedef struct _SYSTEM_POOLTAG_INFORMATION
952 {
953 ULONG Count;
954 SYSTEM_POOLTAG TagInfo[1];
955 } SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION;
956
957 // Class 23
958 typedef struct _SYSTEM_INTERRUPT_INFORMATION
959 {
960 ULONG ContextSwitches;
961 ULONG DpcCount;
962 ULONG DpcRate;
963 ULONG TimeIncrement;
964 ULONG DpcBypassCount;
965 ULONG ApcBypassCount;
966 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
967
968 // Class 24
969 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
970 {
971 ULONG Spare;
972 ULONG DpcQueueDepth;
973 ULONG MinimumDpcRate;
974 ULONG AdjustDpcThreshold;
975 ULONG IdealDpcRate;
976 } SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION;
977
978 // Class 25
979 typedef struct _SYSTEM_MEMORY_INFO
980 {
981 PUCHAR StringOffset;
982 USHORT ValidCount;
983 USHORT TransitionCount;
984 USHORT ModifiedCount;
985 USHORT PageTableCount;
986 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
987 typedef struct _SYSTEM_MEMORY_INFORMATION
988 {
989 ULONG InfoSize;
990 ULONG StringStart;
991 SYSTEM_MEMORY_INFO Memory[1];
992 } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION;
993
994 // Class 26
995 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
996 {
997 UNICODE_STRING DriverName;
998 PVOID ImageAddress;
999 PVOID SectionPointer;
1000 PVOID EntryPoint;
1001 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
1002 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
1003
1004 // Class 27
1005 // Not an actually class, simply a PVOID to the ImageAddress
1006
1007 // Class 28
1008 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1009 {
1010 ULONG TimeAdjustment;
1011 ULONG TimeIncrement;
1012 BOOLEAN Enable;
1013 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION;
1014
1015 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1016 {
1017 ULONG TimeAdjustment;
1018 BOOLEAN Enable;
1019 } SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION;
1020
1021 // Class 29 - Same as 25
1022
1023 // FIXME: Class 30 - 31
1024
1025 // Class 32
1026 typedef struct _SYSTEM_CRASH_DUMP_INFORMATION
1027 {
1028 HANDLE CrashDumpSection;
1029 } SYSTEM_CRASH_DUMP_INFORMATION, *PSYSTEM_CRASH_DUMP_INFORMATION;
1030
1031 // Class 33
1032 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1033 {
1034 ULONG AlignmentFixupCount;
1035 ULONG ExceptionDispatchCount;
1036 ULONG FloatingEmulationCount;
1037 ULONG ByteWordEmulationCount;
1038 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1039
1040 // Class 34
1041 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1042 {
1043 ULONG ValidCrashDump;
1044 } SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION;
1045
1046 // Class 35
1047 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1048 {
1049 BOOLEAN KernelDebuggerEnabled;
1050 BOOLEAN KernelDebuggerNotPresent;
1051 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1052
1053 // Class 36
1054 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1055 {
1056 ULONG ContextSwitches;
1057 ULONG FindAny;
1058 ULONG FindLast;
1059 ULONG FindIdeal;
1060 ULONG IdleAny;
1061 ULONG IdleCurrent;
1062 ULONG IdleLast;
1063 ULONG IdleIdeal;
1064 ULONG PreemptAny;
1065 ULONG PreemptCurrent;
1066 ULONG PreemptLast;
1067 ULONG SwitchToIdle;
1068 } SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION;
1069
1070 // Class 37
1071 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1072 {
1073 ULONG RegistryQuotaAllowed;
1074 ULONG RegistryQuotaUsed;
1075 ULONG PagedPoolSize;
1076 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1077
1078 // Class 38
1079 // Not a structure, simply send the UNICODE_STRING
1080
1081 // Class 39
1082 // Not a structure, simply send a ULONG containing the new separation
1083
1084 // Class 40
1085 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1086 {
1087 ULONG BusCount;
1088 PLUGPLAY_BUS_INSTANCE BusInstance[1];
1089 } SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION;
1090
1091 // Class 41
1092 typedef struct _SYSTEM_DOCK_INFORMATION
1093 {
1094 SYSTEM_DOCK_STATE DockState;
1095 INTERFACE_TYPE DeviceBusType;
1096 ULONG DeviceBusNumber;
1097 ULONG SlotNumber;
1098 } SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION;
1099
1100 // Class 42
1101 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1102 {
1103 BOOLEAN SystemSuspendSupported;
1104 BOOLEAN SystemHibernateSupported;
1105 BOOLEAN ResumeTimerSupportsSuspend;
1106 BOOLEAN ResumeTimerSupportsHibernate;
1107 BOOLEAN LidSupported;
1108 BOOLEAN TurboSettingSupported;
1109 BOOLEAN TurboMode;
1110 BOOLEAN SystemAcOrDc;
1111 BOOLEAN PowerDownDisabled;
1112 LARGE_INTEGER SpindownDrives;
1113 } SYSTEM_POWER_INFORMATION_NATIVE, *PSYSTEM_POWER_INFORMATION_NATIVE;
1114
1115 // Class 43
1116 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1117 {
1118 PNP_VETO_TYPE VetoType;
1119 UNICODE_STRING VetoDriver;
1120 // CHAR Buffer[0];
1121 } SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
1122
1123 // Class 44
1124 typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1125
1126 // Class 45
1127 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1128 {
1129 USHORT CurrentDepth;
1130 USHORT MaximumDepth;
1131 ULONG TotalAllocates;
1132 ULONG AllocateMisses;
1133 ULONG TotalFrees;
1134 ULONG FreeMisses;
1135 ULONG Type;
1136 ULONG Tag;
1137 ULONG Size;
1138 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1139
1140 // Class 46
1141 // Not a structure. Only a HANDLE for the SlipEvent;
1142
1143 // Class 47
1144 // Not a structure. Only a ULONG for the SessionId;
1145
1146 // Class 48
1147 // Not a structure. Only a ULONG for the SessionId;
1148
1149 // FIXME: Class 49
1150
1151 // Class 50
1152 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1153
1154 // FIXME: Class 51 (Based on MM_DRIVER_VERIFIER_DATA)
1155
1156 // FIXME: Class 52
1157
1158 // Class 53
1159 typedef struct _SYSTEM_SESSION_PROCESSES_INFORMATION
1160 {
1161 ULONG SessionId;
1162 ULONG BufferSize;
1163 PVOID Buffer; // Same format as in SystemProcessInformation
1164 } SYSTEM_SESSION_PROCESSES_INFORMATION, *PSYSTEM_SESSION_PROCESSES_INFORMATION;
1165
1166 #endif