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