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