3 Copyright (c) Alex Ionescu. All rights reserved.
11 Type definitions for the Executive.
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
27 #if defined(_MSC_VER) && !defined(NTOS_MODE_USER)
36 // Atom and Language IDs
38 typedef USHORT LANGID
, *PLANGID
;
39 typedef USHORT RTL_ATOM
, *PRTL_ATOM
;
41 #ifndef NTOS_MODE_USER
44 // Kernel Exported Object Types
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
;
53 // Exported NT Build Number
55 extern ULONG NTSYSAPI NtBuildNumber
;
58 // Invalid Handle Value Constant
60 #define INVALID_HANDLE_VALUE (HANDLE)-1
67 #define MUTANT_INCREMENT 1
70 // Callback Object Access Mask
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)
78 // Event Object Access Masks
81 #define EVENT_QUERY_STATE 0x0001
84 // Semaphore Object Acess Masks
86 #define SEMAPHORE_QUERY_STATE 0x0001
90 // Event Pair Access Masks
92 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
95 // Profile Object Access Masks
97 #define PROFILE_CONTROL 0x0001
98 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
101 // Maximum Parameters for NtRaiseHardError
103 #define MAXIMUM_HARDERROR_PARAMETERS 4
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)
117 // Pushlock Wait Block Flags
119 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
120 #define EX_PUSH_LOCK_FLAGS_WAIT 2
123 // Resource (ERESOURCE) Flags
125 #define ResourceHasDisabledPriorityBoost 0x08
128 // Shutdown types for NtShutdownSystem
130 typedef enum _SHUTDOWN_ACTION
138 // Responses for NtRaiseHardError
140 typedef enum _HARDERROR_RESPONSE_OPTION
142 OptionAbortRetryIgnore
,
149 } HARDERROR_RESPONSE_OPTION
, *PHARDERROR_RESPONSE_OPTION
;
151 typedef enum _HARDERROR_RESPONSE
153 ResponseReturnToCaller
,
162 } HARDERROR_RESPONSE
, *PHARDERROR_RESPONSE
;
165 // System Information Classes for NtQuerySystemInformation
167 typedef enum _SYSTEM_INFORMATION_CLASS
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 SystemMirrorMemoryInformation
,
200 SystemPerformanceTraceInformation
,
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
,
218 SystemSessionInformation
,
219 SystemRangeStartInformation
,
220 SystemVerifierInformation
,
222 SystemSessionProcessesInformation
,
223 SystemLoadGdiDriverInSystemSpaceInformation
,
224 SystemNumaProcessorMap
,
225 SystemPrefetcherInformation
,
226 SystemExtendedProcessInformation
,
227 SystemRecommendedSharedDataAlignment
,
228 SystemComPlusPackage
,
229 SystemNumaAvailableMemory
,
230 SystemProcessorPowerInformation
,
231 SystemEmulationBasicInformation
,
232 SystemEmulationProcessorInformation
,
233 SystemExtendedHanfleInformation
,
234 SystemLostDelayedWriteInformation
,
235 SystemBigPoolInformation
,
236 SystemSessionPoolTagInformation
,
237 SystemSessionMappedViewInformation
,
238 SystemHotpatchInformation
,
239 SystemObjectSecurityMode
,
240 SystemWatchDogTimerHandler
,
241 SystemWatchDogTimerInformation
,
242 SystemLogicalProcessorInformation
,
243 SystemWo64SharedInformationObosolete
,
244 SystemRegisterFirmwareTableInformationHandler
,
245 SystemFirmwareTableInformation
,
246 SystemModuleInformationEx
,
247 SystemVerifierTriageInformation
,
248 SystemSuperfetchInformation
,
249 SystemMemoryListInformation
,
250 SystemFileCacheInformationEx
,
251 SystemThreadPriorityClientIdInformation
,
252 SystemProcessorIdleCycleTimeInformation
,
253 SystemVerifierCancellationInformation
,
254 SystemProcessorPowerInformationEx
,
255 SystemRefTraceInformation
,
256 SystemSpecialPoolInformation
,
257 SystemProcessIdInformation
,
258 SystemErrorPortInformation
,
259 SystemBootEnvironmentInformation
,
260 SystemHypervisorInformation
,
261 SystemVerifierInformationEx
,
262 SystemTimeZoneInformation
,
263 SystemImageFileExecutionOptionsInformation
,
264 SystemCoverageInformation
,
265 SystemPrefetchPathInformation
,
266 SystemVerifierFaultsInformation
,
268 } SYSTEM_INFORMATION_CLASS
;
271 // System Information Classes for NtQueryMutant
273 typedef enum _MUTANT_INFORMATION_CLASS
275 MutantBasicInformation
,
276 MutantOwnerInformation
277 } MUTANT_INFORMATION_CLASS
;
280 // System Information Classes for NtQueryAtom
282 typedef enum _ATOM_INFORMATION_CLASS
284 AtomBasicInformation
,
285 AtomTableInformation
,
286 } ATOM_INFORMATION_CLASS
;
289 // System Information Classes for NtQueryTimer
291 typedef enum _TIMER_INFORMATION_CLASS
293 TimerBasicInformation
294 } TIMER_INFORMATION_CLASS
;
297 // System Information Classes for NtQuerySemaphore
299 typedef enum _SEMAPHORE_INFORMATION_CLASS
301 SemaphoreBasicInformation
302 } SEMAPHORE_INFORMATION_CLASS
;
305 // System Information Classes for NtQueryEvent
307 typedef enum _EVENT_INFORMATION_CLASS
309 EventBasicInformation
310 } EVENT_INFORMATION_CLASS
;
312 #ifdef NTOS_MODE_USER
315 // Firmware Table Actions for SystemFirmwareTableInformation
317 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
319 SystemFirmwareTable_Enumerate
= 0,
320 SystemFirmwareTable_Get
= 1,
321 } SYSTEM_FIRMWARE_TABLE_ACTION
, *PSYSTEM_FIRMWARE_TABLE_ACTION
;
324 // Firmware Handler Callback
326 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
;
330 IN
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
*FirmwareTableInformation
336 // Executive Work Queue Structures
338 typedef struct _EX_QUEUE_WORKER_INFO
340 ULONG QueueDisabled
:1;
341 ULONG MakeThreadsAsNecessary
:1;
343 ULONG WorkerCount
:29;
344 } EX_QUEUE_WORKER_INFO
, *PEX_QUEUE_WORKER_INFO
;
346 typedef struct _EX_WORK_QUEUE
349 LONG DynamicThreadCount
;
350 ULONG WorkItemsProcessed
;
351 ULONG WorkItemsProcessedLastPass
;
352 ULONG QueueDepthLastPass
;
353 EX_QUEUE_WORKER_INFO Info
;
354 } EX_WORK_QUEUE
, *PEX_WORK_QUEUE
;
357 // Executive Fast Reference Structure
359 typedef struct _EX_FAST_REF
367 } EX_FAST_REF
, *PEX_FAST_REF
;
370 // Executive Cache-Aware Rundown Reference Descriptor
372 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
374 PEX_RUNDOWN_REF RunRefs
;
378 } EX_RUNDOWN_REF_CACHE_AWARE
, *PEX_RUNDOWN_REF_CACHE_AWARE
;
381 // Executive Rundown Wait Block
383 typedef struct _EX_RUNDOWN_WAIT_BLOCK
387 } EX_RUNDOWN_WAIT_BLOCK
, *PEX_RUNDOWN_WAIT_BLOCK
;
390 // Executive Pushlock
394 typedef struct _EX_PUSH_LOCK
403 ULONG_PTR MultipleShared
:1;
404 ULONG_PTR Shared
:sizeof (ULONG_PTR
) * 8 - 4;
409 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
412 // Executive Pushlock Wait Block
414 #ifndef __GNUC__ // WARNING! PUSHLOCKS WILL NOT WORK IN GCC FOR NOW!!!
415 __declspec(align(16))
417 typedef struct _EX_PUSH_LOCK_WAIT_BLOCK
424 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Next
;
425 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Last
;
426 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Previous
;
431 EX_PUSH_LOCK NewValue
;
432 EX_PUSH_LOCK OldValue
;
433 PEX_PUSH_LOCK PushLock
;
435 } EX_PUSH_LOCK_WAIT_BLOCK
, *PEX_PUSH_LOCK_WAIT_BLOCK
;
440 typedef struct _CALLBACK_OBJECT
444 LIST_ENTRY RegisteredCallbacks
;
445 ULONG AllowMultipleCallbacks
;
446 } CALLBACK_OBJECT
, *PCALLBACK_OBJECT
;
451 typedef struct _EPROFILE
459 PKPROFILE ProfileObject
;
460 PVOID LockedBufferAddress
;
463 KPROFILE_SOURCE ProfileSource
;
465 } EPROFILE
, *PEPROFILE
;
468 // Handle Table Structures
470 typedef struct _HANDLE_TRACE_DB_ENTRY
475 PVOID StackTrace
[16];
476 } HANDLE_TRACE_DB_ENTRY
, *PHANDLE_TRACE_DB_ENTRY
;
478 typedef struct _HANDLE_TRACE_DEBUG_INFO
483 FAST_MUTEX CloseCompatcionLock
;
484 ULONG CurrentStackIndex
;
485 HANDLE_TRACE_DB_ENTRY TraceDb
[1];
486 } HANDLE_TRACE_DEBUG_INFO
, *PHANDLE_TRACE_DEBUG_INFO
;
488 typedef struct _HANDLE_TABLE_ENTRY_INFO
491 } HANDLE_TABLE_ENTRY_INFO
, *PHANDLE_TABLE_ENTRY_INFO
;
493 typedef struct _HANDLE_TABLE_ENTRY
498 ULONG_PTR ObAttributes
;
499 PHANDLE_TABLE_ENTRY_INFO InfoTable
;
507 USHORT GrantedAccessIndex
;
508 USHORT CreatorBackTraceIndex
;
510 LONG NextFreeTableEntry
;
512 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
514 typedef struct _HANDLE_TABLE
516 #if (NTDDI_VERSION >= NTDDI_WINXP)
519 PHANDLE_TABLE_ENTRY
**Table
;
521 PEPROCESS QuotaProcess
;
522 PVOID UniqueProcessId
;
523 #if (NTDDI_VERSION >= NTDDI_WINXP)
524 EX_PUSH_LOCK HandleLock
;
525 LIST_ENTRY HandleTableList
;
526 EX_PUSH_LOCK HandleContentionEvent
;
528 ERESOURCE HandleLock
;
529 LIST_ENTRY HandleTableList
;
530 KEVENT HandleContentionEvent
;
532 PHANDLE_TRACE_DEBUG_INFO DebugInfo
;
534 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
540 LONG FirstFreeHandle
;
541 PHANDLE_TABLE_ENTRY LastFreeHandleEntry
;
543 ULONG NextHandleNeedingPool
;
547 ULONG NextHandleNeedingPool
;
555 } HANDLE_TABLE
, *PHANDLE_TABLE
;
560 // Hard Error LPC Message
562 typedef struct _HARDERROR_MSG
566 LARGE_INTEGER ErrorTime
;
567 ULONG ValidResponseOptions
;
569 ULONG NumberOfParameters
;
570 ULONG UnicodeStringParameterMask
;
571 ULONG Parameters
[MAXIMUM_HARDERROR_PARAMETERS
];
572 } HARDERROR_MSG
, *PHARDERROR_MSG
;
575 // Information Structures for NtQueryMutant
577 typedef struct _MUTANT_BASIC_INFORMATION
580 BOOLEAN OwnedByCaller
;
581 BOOLEAN AbandonedState
;
582 } MUTANT_BASIC_INFORMATION
, *PMUTANT_BASIC_INFORMATION
;
584 typedef struct _MUTANT_OWNER_INFORMATION
587 } MUTANT_OWNER_INFORMATION
, *PMUTANT_OWNER_INFORMATION
;
590 // Information Structures for NtQueryAtom
592 typedef struct _ATOM_BASIC_INFORMATION
598 } ATOM_BASIC_INFORMATION
, *PATOM_BASIC_INFORMATION
;
600 typedef struct _ATOM_TABLE_INFORMATION
604 } ATOM_TABLE_INFORMATION
, *PATOM_TABLE_INFORMATION
;
607 // Information Structures for NtQueryTimer
609 typedef struct _TIMER_BASIC_INFORMATION
611 LARGE_INTEGER TimeRemaining
;
613 } TIMER_BASIC_INFORMATION
, *PTIMER_BASIC_INFORMATION
;
616 // Information Structures for NtQuerySemaphore
618 typedef struct _SEMAPHORE_BASIC_INFORMATION
622 } SEMAPHORE_BASIC_INFORMATION
, *PSEMAPHORE_BASIC_INFORMATION
;
625 // Information Structures for NtQueryEvent
627 typedef struct _EVENT_BASIC_INFORMATION
629 EVENT_TYPE EventType
;
631 } EVENT_BASIC_INFORMATION
, *PEVENT_BASIC_INFORMATION
;
634 // Information Structures for NtQuerySystemInformation
636 typedef struct _SYSTEM_BASIC_INFORMATION
639 ULONG TimerResolution
;
641 ULONG NumberOfPhysicalPages
;
642 ULONG LowestPhysicalPageNumber
;
643 ULONG HighestPhysicalPageNumber
;
644 ULONG AllocationGranularity
;
645 ULONG MinimumUserModeAddress
;
646 ULONG MaximumUserModeAddress
;
647 KAFFINITY ActiveProcessorsAffinityMask
;
648 CCHAR NumberOfProcessors
;
649 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
652 typedef struct _SYSTEM_PROCESSOR_INFORMATION
654 USHORT ProcessorArchitecture
;
655 USHORT ProcessorLevel
;
656 USHORT ProcessorRevision
;
658 ULONG ProcessorFeatureBits
;
659 } SYSTEM_PROCESSOR_INFORMATION
, *PSYSTEM_PROCESSOR_INFORMATION
;
662 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
664 LARGE_INTEGER IdleProcessTime
;
665 LARGE_INTEGER IoReadTransferCount
;
666 LARGE_INTEGER IoWriteTransferCount
;
667 LARGE_INTEGER IoOtherTransferCount
;
668 ULONG IoReadOperationCount
;
669 ULONG IoWriteOperationCount
;
670 ULONG IoOtherOperationCount
;
671 ULONG AvailablePages
;
672 ULONG CommittedPages
;
674 ULONG PeakCommitment
;
675 ULONG PageFaultCount
;
676 ULONG CopyOnWriteCount
;
677 ULONG TransitionCount
;
678 ULONG CacheTransitionCount
;
679 ULONG DemandZeroCount
;
681 ULONG PageReadIoCount
;
682 ULONG CacheReadCount
;
684 ULONG DirtyPagesWriteCount
;
685 ULONG DirtyWriteIoCount
;
686 ULONG MappedPagesWriteCount
;
687 ULONG MappedWriteIoCount
;
688 ULONG PagedPoolPages
;
689 ULONG NonPagedPoolPages
;
690 ULONG PagedPoolAllocs
;
691 ULONG PagedPoolFrees
;
692 ULONG NonPagedPoolAllocs
;
693 ULONG NonPagedPoolFrees
;
694 ULONG FreeSystemPtes
;
695 ULONG ResidentSystemCodePage
;
696 ULONG TotalSystemDriverPages
;
697 ULONG TotalSystemCodePages
;
698 ULONG NonPagedPoolLookasideHits
;
699 ULONG PagedPoolLookasideHits
;
701 ULONG ResidentSystemCachePage
;
702 ULONG ResidentPagedPoolPage
;
703 ULONG ResidentSystemDriverPage
;
704 ULONG CcFastReadNoWait
;
705 ULONG CcFastReadWait
;
706 ULONG CcFastReadResourceMiss
;
707 ULONG CcFastReadNotPossible
;
708 ULONG CcFastMdlReadNoWait
;
709 ULONG CcFastMdlReadWait
;
710 ULONG CcFastMdlReadResourceMiss
;
711 ULONG CcFastMdlReadNotPossible
;
712 ULONG CcMapDataNoWait
;
714 ULONG CcMapDataNoWaitMiss
;
715 ULONG CcMapDataWaitMiss
;
716 ULONG CcPinMappedDataCount
;
717 ULONG CcPinReadNoWait
;
719 ULONG CcPinReadNoWaitMiss
;
720 ULONG CcPinReadWaitMiss
;
721 ULONG CcCopyReadNoWait
;
722 ULONG CcCopyReadWait
;
723 ULONG CcCopyReadNoWaitMiss
;
724 ULONG CcCopyReadWaitMiss
;
725 ULONG CcMdlReadNoWait
;
727 ULONG CcMdlReadNoWaitMiss
;
728 ULONG CcMdlReadWaitMiss
;
729 ULONG CcReadAheadIos
;
730 ULONG CcLazyWriteIos
;
731 ULONG CcLazyWritePages
;
734 ULONG ContextSwitches
;
735 ULONG FirstLevelTbFills
;
736 ULONG SecondLevelTbFills
;
738 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
741 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
743 LARGE_INTEGER BootTime
;
744 LARGE_INTEGER CurrentTime
;
745 LARGE_INTEGER TimeZoneBias
;
748 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
751 // This class is obsolete, please use KUSER_SHARED_DATA instead
754 typedef struct _SYSTEM_THREAD_INFORMATION
756 LARGE_INTEGER KernelTime
;
757 LARGE_INTEGER UserTime
;
758 LARGE_INTEGER CreateTime
;
764 ULONG ContextSwitches
;
767 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
769 typedef struct _SYSTEM_PROCESS_INFORMATION
771 ULONG NextEntryOffset
;
772 ULONG NumberOfThreads
;
773 LARGE_INTEGER SpareLi1
;
774 LARGE_INTEGER SpareLi2
;
775 LARGE_INTEGER SpareLi3
;
776 LARGE_INTEGER CreateTime
;
777 LARGE_INTEGER UserTime
;
778 LARGE_INTEGER KernelTime
;
779 UNICODE_STRING ImageName
;
780 KPRIORITY BasePriority
;
781 HANDLE UniqueProcessId
;
782 HANDLE InheritedFromUniqueProcessId
;
785 ULONG UniqueProcessKey
;
788 // This part corresponds to VM_COUNTERS_EX.
789 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
791 ULONG PeakVirtualSize
;
793 ULONG PageFaultCount
;
794 ULONG PeakWorkingSetSize
;
795 ULONG WorkingSetSize
;
796 ULONG QuotaPeakPagedPoolUsage
;
797 ULONG QuotaPagedPoolUsage
;
798 ULONG QuotaPeakNonPagedPoolUsage
;
799 ULONG QuotaNonPagedPoolUsage
;
801 ULONG PeakPagefileUsage
;
802 ULONG PrivatePageCount
;
805 // This part corresponds to IO_COUNTERS
807 LARGE_INTEGER ReadOperationCount
;
808 LARGE_INTEGER WriteOperationCount
;
809 LARGE_INTEGER OtherOperationCount
;
810 LARGE_INTEGER ReadTransferCount
;
811 LARGE_INTEGER WriteTransferCount
;
812 LARGE_INTEGER OtherTransferCount
;
814 //SYSTEM_THREAD_INFORMATION TH[1];
815 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
818 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
821 ULONG NumberOfTables
;
822 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
825 typedef struct _SYSTEM_DEVICE_INFORMATION
828 ULONG NumberOfFloppies
;
829 ULONG NumberOfCdRoms
;
831 ULONG NumberOfSerialPorts
;
832 ULONG NumberOfParallelPorts
;
833 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
836 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
838 LARGE_INTEGER IdleTime
;
839 LARGE_INTEGER KernelTime
;
840 LARGE_INTEGER UserTime
;
841 LARGE_INTEGER DpcTime
;
842 LARGE_INTEGER InterruptTime
;
843 ULONG InterruptCount
;
844 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
847 typedef struct _SYSTEM_FLAGS_INFORMATION
850 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
853 typedef struct _SYSTEM_CALL_TIME_INFORMATION
857 LARGE_INTEGER TimeOfCalls
[1];
858 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
860 // Class 11 - See RTL_PROCESS_MODULES
862 // Class 12 - See RTL_PROCESS_LOCKS
864 // Class 13 - See RTL_PROCESS_BACKTRACES
867 typedef struct _SYSTEM_POOL_ENTRY
871 USHORT AllocatorBackTraceIndex
;
877 PVOID ProcessChargedQuota
;
879 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
881 typedef struct _SYSTEM_POOL_INFORMATION
885 USHORT EntryOverhead
;
886 BOOLEAN PoolTagPresent
;
888 ULONG NumberOfEntries
;
889 SYSTEM_POOL_ENTRY Entries
[1];
890 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
893 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
895 USHORT UniqueProcessId
;
896 USHORT CreatorBackTraceIndex
;
897 UCHAR ObjectTypeIndex
;
898 UCHAR HandleAttributes
;
902 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
904 typedef struct _SYSTEM_HANDLE_INFORMATION
906 ULONG NumberOfHandles
;
907 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
908 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
911 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
913 ULONG NextEntryOffset
;
914 ULONG NumberOfObjects
;
915 ULONG NumberOfHandles
;
917 ULONG InvalidAttributes
;
918 GENERIC_MAPPING GenericMapping
;
919 ULONG ValidAccessMask
;
921 BOOLEAN SecurityRequired
;
922 BOOLEAN WaitableObject
;
923 UNICODE_STRING TypeName
;
924 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
926 typedef struct _SYSTEM_OBJECT_INFORMATION
928 ULONG NextEntryOffset
;
930 HANDLE CreatorUniqueProcess
;
931 USHORT CreatorBackTraceIndex
;
935 ULONG PagedPoolCharge
;
936 ULONG NonPagedPoolCharge
;
937 HANDLE ExclusiveProcessId
;
938 PVOID SecurityDescriptor
;
939 OBJECT_NAME_INFORMATION NameInfo
;
940 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
943 typedef struct _SYSTEM_PAGEFILE_INFORMATION
945 ULONG NextEntryOffset
;
949 UNICODE_STRING PageFileName
;
950 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
953 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
955 ULONG SegmentNotPresent
;
957 ULONG OpcodeESPrefix
;
958 ULONG OpcodeCSPrefix
;
959 ULONG OpcodeSSPrefix
;
960 ULONG OpcodeDSPrefix
;
961 ULONG OpcodeFSPrefix
;
962 ULONG OpcodeGSPrefix
;
963 ULONG OpcodeOPER32Prefix
;
964 ULONG OpcodeADDR32Prefix
;
977 ULONG OpcodeOUTWimm
;
982 ULONG OpcodeLOCKPrefix
;
983 ULONG OpcodeREPNEPrefix
;
984 ULONG OpcodeREPPrefix
;
989 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
991 // Class 20 - ULONG VDMBOPINFO
994 typedef struct _SYSTEM_FILECACHE_INFORMATION
998 ULONG PageFaultCount
;
999 ULONG MinimumWorkingSet
;
1000 ULONG MaximumWorkingSet
;
1001 ULONG CurrentSizeIncludingTransitionInPages
;
1002 ULONG PeakSizeIncludingTransitionInPages
;
1003 ULONG TransitionRePurposeCount
;
1005 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1008 typedef struct _SYSTEM_POOLTAG
1018 ULONG NonPagedAllocs
;
1019 ULONG NonPagedFrees
;
1021 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1022 typedef struct _SYSTEM_POOLTAG_INFORMATION
1025 SYSTEM_POOLTAG TagInfo
[1];
1026 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1029 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1031 ULONG ContextSwitches
;
1034 ULONG TimeIncrement
;
1035 ULONG DpcBypassCount
;
1036 ULONG ApcBypassCount
;
1037 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1040 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1043 ULONG DpcQueueDepth
;
1044 ULONG MinimumDpcRate
;
1045 ULONG AdjustDpcThreshold
;
1047 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1050 typedef struct _SYSTEM_MEMORY_INFO
1052 PUCHAR StringOffset
;
1054 USHORT TransitionCount
;
1055 USHORT ModifiedCount
;
1056 USHORT PageTableCount
;
1057 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1059 typedef struct _SYSTEM_MEMORY_INFORMATION
1063 SYSTEM_MEMORY_INFO Memory
[1];
1064 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1067 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1069 UNICODE_STRING DriverName
;
1071 PVOID SectionPointer
;
1073 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1075 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1078 // Not an actually class, simply a PVOID to the ImageAddress
1081 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1083 ULONG TimeAdjustment
;
1084 ULONG TimeIncrement
;
1086 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1088 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1090 ULONG TimeAdjustment
;
1092 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1094 // Class 29 - Same as 25
1099 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1102 UCHAR TracePermanent
;
1103 UNICODE_STRING TraceProcessName
;
1104 UNICODE_STRING TracePoolTags
;
1105 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1107 // Class 32 - OBSOLETE
1110 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1112 ULONG AlignmentFixupCount
;
1113 ULONG ExceptionDispatchCount
;
1114 ULONG FloatingEmulationCount
;
1115 ULONG ByteWordEmulationCount
;
1116 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1119 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1121 ULONG ValidCrashDump
;
1122 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1125 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1127 BOOLEAN KernelDebuggerEnabled
;
1128 BOOLEAN KernelDebuggerNotPresent
;
1129 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1132 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1134 ULONG ContextSwitches
;
1143 ULONG PreemptCurrent
;
1146 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1149 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1151 ULONG RegistryQuotaAllowed
;
1152 ULONG RegistryQuotaUsed
;
1153 ULONG PagedPoolSize
;
1154 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1157 // Not a structure, simply send the UNICODE_STRING
1160 // Not a structure, simply send a ULONG containing the new separation
1163 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1166 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1167 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1170 typedef struct _SYSTEM_DOCK_INFORMATION
1172 SYSTEM_DOCK_STATE DockState
;
1173 INTERFACE_TYPE DeviceBusType
;
1174 ULONG DeviceBusNumber
;
1176 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1179 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1181 BOOLEAN SystemSuspendSupported
;
1182 BOOLEAN SystemHibernateSupported
;
1183 BOOLEAN ResumeTimerSupportsSuspend
;
1184 BOOLEAN ResumeTimerSupportsHibernate
;
1185 BOOLEAN LidSupported
;
1186 BOOLEAN TurboSettingSupported
;
1188 BOOLEAN SystemAcOrDc
;
1189 BOOLEAN PowerDownDisabled
;
1190 LARGE_INTEGER SpindownDrives
;
1191 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1194 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1196 PNP_VETO_TYPE VetoType
;
1197 UNICODE_STRING VetoDriver
;
1199 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1202 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1205 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1207 USHORT CurrentDepth
;
1208 USHORT MaximumDepth
;
1209 ULONG TotalAllocates
;
1210 ULONG AllocateMisses
;
1216 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1219 // Not a structure. Only a HANDLE for the SlipEvent;
1222 // Not a structure. Only a ULONG for the SessionId;
1225 // Not a structure. Only a ULONG for the SessionId;
1230 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1233 typedef struct _SYSTEM_VERIFIER_INFORMATION
1235 ULONG NextEntryOffset
;
1237 UNICODE_STRING DriverName
;
1239 ULONG AcquireSpinLocks
;
1240 ULONG SynchronizeExecutions
;
1241 ULONG AllocationsAttempted
;
1242 ULONG AllocationsSucceeded
;
1243 ULONG AllocationsSucceededSpecialPool
;
1244 ULONG AllocationsWithNoTag
;
1247 ULONG AllocationsFailed
;
1248 ULONG AllocationsFailedDeliberately
;
1251 ULONG UnTrackedPool
;
1252 ULONG CurrentPagedPoolAllocations
;
1253 ULONG CurrentNonPagedPoolAllocations
;
1254 ULONG PeakPagedPoolAllocations
;
1255 ULONG PeakNonPagedPoolAllocations
;
1256 ULONG PagedPoolUsageInBytes
;
1257 ULONG NonPagedPoolUsageInBytes
;
1258 ULONG PeakPagedPoolUsageInBytes
;
1259 ULONG PeakNonPagedPoolUsageInBytes
;
1260 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1265 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1269 PVOID Buffer
; // Same format as in SystemProcessInformation
1270 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1272 // FIXME: Class 54-97
1277 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1278 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1279 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1280 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1281 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1282 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1286 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1305 USHORT TargetNameOffset
;
1306 USHORT TargetNameLength
;
1307 UCHAR PatchingFinished
;
1313 USHORT TargetNameOffset
;
1314 USHORT TargetNameLength
;
1315 UCHAR PatchingFinished
;
1316 NTSTATUS ReturnCode
;
1317 HANDLE TargetProcess
;
1322 PIO_STATUS_BLOCK IoStatusBlock1
;
1323 PVOID RenameInformation1
;
1324 PVOID RenameInformationLength1
;
1326 PIO_STATUS_BLOCK IoStatusBlock2
;
1327 PVOID RenameInformation2
;
1328 PVOID RenameInformationLength2
;
1332 HANDLE ParentDirectory
;
1333 HANDLE ObjectHandle1
;
1334 HANDLE ObjectHandle2
;
1337 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1342 #ifdef NTOS_MODE_USER
1343 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1345 ULONG ProviderSignature
;
1347 PFNFTH FirmwareTableHandler
;
1349 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1354 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1356 ULONG ProviderSignature
;
1357 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1359 ULONG TableBufferLength
;
1360 UCHAR TableBuffer
[1];
1361 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;