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(NTOS_MODE_USER)
42 #define __ALIGNED(n) __attribute__((aligned (n)))
43 #elif defined(_MSC_VER)
44 #define __ALIGNED(n) __declspec(align(n))
46 #error __ALIGNED not defined for your compiler!
52 typedef USHORT RTL_ATOM
, *PRTL_ATOM
;
54 #ifndef NTOS_MODE_USER
57 // Kernel Exported Object Types
59 extern POBJECT_TYPE NTSYSAPI ExDesktopObjectType
;
60 extern POBJECT_TYPE NTSYSAPI ExWindowStationObjectType
;
61 extern POBJECT_TYPE NTSYSAPI ExIoCompletionType
;
62 extern POBJECT_TYPE NTSYSAPI ExMutantObjectType
;
63 extern POBJECT_TYPE NTSYSAPI ExTimerType
;
66 // Exported NT Build Number
68 extern ULONG NtBuildNumber
;
71 // Invalid Handle Value Constant
73 #define INVALID_HANDLE_VALUE (HANDLE)-1
80 #define MUTANT_INCREMENT 1
83 // Callback Object Access Mask
85 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
86 #define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
87 #define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
88 #define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
91 // Event Object Access Masks
94 #define EVENT_QUERY_STATE 0x0001
97 // Semaphore Object Access Masks
99 #define SEMAPHORE_QUERY_STATE 0x0001
103 // Mutant Object Access Masks
105 #define MUTANT_QUERY_STATE 0x0001
106 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
110 #define TIMER_QUERY_STATE 0x0001
111 #define TIMER_MODIFY_STATE 0x0002
112 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
114 TIMER_QUERY_STATE | \
119 // Event Pair Access Masks
121 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
124 // Profile Object Access Masks
126 #define PROFILE_CONTROL 0x0001
127 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
130 // Maximum Parameters for NtRaiseHardError
132 #define MAXIMUM_HARDERROR_PARAMETERS 4
137 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
138 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
139 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
140 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
141 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
142 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
143 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
146 // Pushlock Wait Block Flags
148 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
149 #define EX_PUSH_LOCK_FLAGS_WAIT_V 1
150 #define EX_PUSH_LOCK_FLAGS_WAIT 2
153 // Resource (ERESOURCE) Flags
155 #define ResourceHasDisabledPriorityBoost 0x08
158 // Shutdown types for NtShutdownSystem
160 typedef enum _SHUTDOWN_ACTION
168 // Responses for NtRaiseHardError
170 typedef enum _HARDERROR_RESPONSE_OPTION
172 OptionAbortRetryIgnore
,
179 } HARDERROR_RESPONSE_OPTION
, *PHARDERROR_RESPONSE_OPTION
;
181 typedef enum _HARDERROR_RESPONSE
183 ResponseReturnToCaller
,
194 } HARDERROR_RESPONSE
, *PHARDERROR_RESPONSE
;
197 // System Information Classes for NtQuerySystemInformation
199 typedef enum _SYSTEM_INFORMATION_CLASS
201 SystemBasicInformation
,
202 SystemProcessorInformation
,
203 SystemPerformanceInformation
,
204 SystemTimeOfDayInformation
,
205 SystemPathInformation
, /// Obsolete: Use KUSER_SHARED_DATA
206 SystemProcessInformation
,
207 SystemCallCountInformation
,
208 SystemDeviceInformation
,
209 SystemProcessorPerformanceInformation
,
210 SystemFlagsInformation
,
211 SystemCallTimeInformation
,
212 SystemModuleInformation
,
213 SystemLocksInformation
,
214 SystemStackTraceInformation
,
215 SystemPagedPoolInformation
,
216 SystemNonPagedPoolInformation
,
217 SystemHandleInformation
,
218 SystemObjectInformation
,
219 SystemPageFileInformation
,
220 SystemVdmInstemulInformation
,
221 SystemVdmBopInformation
,
222 SystemFileCacheInformation
,
223 SystemPoolTagInformation
,
224 SystemInterruptInformation
,
225 SystemDpcBehaviorInformation
,
226 SystemFullMemoryInformation
,
227 SystemLoadGdiDriverInformation
,
228 SystemUnloadGdiDriverInformation
,
229 SystemTimeAdjustmentInformation
,
230 SystemSummaryMemoryInformation
,
231 SystemMirrorMemoryInformation
,
232 SystemPerformanceTraceInformation
,
234 SystemExceptionInformation
,
235 SystemCrashDumpStateInformation
,
236 SystemKernelDebuggerInformation
,
237 SystemContextSwitchInformation
,
238 SystemRegistryQuotaInformation
,
239 SystemExtendServiceTableInformation
,
240 SystemPrioritySeperation
,
241 SystemPlugPlayBusInformation
,
242 SystemDockInformation
,
243 SystemPowerInformationNative
,
244 SystemProcessorSpeedInformation
,
245 SystemCurrentTimeZoneInformation
,
246 SystemLookasideInformation
,
247 SystemTimeSlipNotification
,
250 SystemSessionInformation
,
251 SystemRangeStartInformation
,
252 SystemVerifierInformation
,
254 SystemSessionProcessesInformation
,
255 SystemLoadGdiDriverInSystemSpaceInformation
,
256 SystemNumaProcessorMap
,
257 SystemPrefetcherInformation
,
258 SystemExtendedProcessInformation
,
259 SystemRecommendedSharedDataAlignment
,
260 SystemComPlusPackage
,
261 SystemNumaAvailableMemory
,
262 SystemProcessorPowerInformation
,
263 SystemEmulationBasicInformation
,
264 SystemEmulationProcessorInformation
,
265 SystemExtendedHanfleInformation
,
266 SystemLostDelayedWriteInformation
,
267 SystemBigPoolInformation
,
268 SystemSessionPoolTagInformation
,
269 SystemSessionMappedViewInformation
,
270 SystemHotpatchInformation
,
271 SystemObjectSecurityMode
,
272 SystemWatchDogTimerHandler
,
273 SystemWatchDogTimerInformation
,
274 SystemLogicalProcessorInformation
,
275 SystemWow64SharedInformationObsolete
,
276 SystemRegisterFirmwareTableInformationHandler
,
277 SystemFirmwareTableInformation
,
278 SystemModuleInformationEx
,
279 SystemVerifierTriageInformation
,
280 SystemSuperfetchInformation
,
281 SystemMemoryListInformation
,
282 SystemFileCacheInformationEx
,
283 SystemThreadPriorityClientIdInformation
,
284 SystemProcessorIdleCycleTimeInformation
,
285 SystemVerifierCancellationInformation
,
286 SystemProcessorPowerInformationEx
,
287 SystemRefTraceInformation
,
288 SystemSpecialPoolInformation
,
289 SystemProcessIdInformation
,
290 SystemErrorPortInformation
,
291 SystemBootEnvironmentInformation
,
292 SystemHypervisorInformation
,
293 SystemVerifierInformationEx
,
294 SystemTimeZoneInformation
,
295 SystemImageFileExecutionOptionsInformation
,
296 SystemCoverageInformation
,
297 SystemPrefetchPathInformation
,
298 SystemVerifierFaultsInformation
,
300 } SYSTEM_INFORMATION_CLASS
;
303 // System Information Classes for NtQueryMutant
305 typedef enum _MUTANT_INFORMATION_CLASS
307 MutantBasicInformation
,
308 MutantOwnerInformation
309 } MUTANT_INFORMATION_CLASS
;
312 // System Information Classes for NtQueryAtom
314 typedef enum _ATOM_INFORMATION_CLASS
316 AtomBasicInformation
,
317 AtomTableInformation
,
318 } ATOM_INFORMATION_CLASS
;
321 // System Information Classes for NtQueryTimer
323 typedef enum _TIMER_INFORMATION_CLASS
325 TimerBasicInformation
326 } TIMER_INFORMATION_CLASS
;
329 // System Information Classes for NtQuerySemaphore
331 typedef enum _SEMAPHORE_INFORMATION_CLASS
333 SemaphoreBasicInformation
334 } SEMAPHORE_INFORMATION_CLASS
;
337 // System Information Classes for NtQueryEvent
339 typedef enum _EVENT_INFORMATION_CLASS
341 EventBasicInformation
342 } EVENT_INFORMATION_CLASS
;
344 #ifdef NTOS_MODE_USER
347 // Firmware Table Actions for SystemFirmwareTableInformation
349 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
351 SystemFirmwareTable_Enumerate
= 0,
352 SystemFirmwareTable_Get
= 1,
353 } SYSTEM_FIRMWARE_TABLE_ACTION
, *PSYSTEM_FIRMWARE_TABLE_ACTION
;
356 // Firmware Handler Callback
358 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
;
362 IN
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
*FirmwareTableInformation
368 // Handle Enumeration Callback
370 struct _HANDLE_TABLE_ENTRY
;
372 (NTAPI
*PEX_ENUM_HANDLE_CALLBACK
)(
373 IN
struct _HANDLE_TABLE_ENTRY
*HandleTableEntry
,
379 // Executive Work Queue Structures
381 typedef struct _EX_QUEUE_WORKER_INFO
383 ULONG QueueDisabled
:1;
384 ULONG MakeThreadsAsNecessary
:1;
386 ULONG WorkerCount
:29;
387 } EX_QUEUE_WORKER_INFO
, *PEX_QUEUE_WORKER_INFO
;
389 typedef struct _EX_WORK_QUEUE
392 LONG DynamicThreadCount
;
393 ULONG WorkItemsProcessed
;
394 ULONG WorkItemsProcessedLastPass
;
395 ULONG QueueDepthLastPass
;
396 EX_QUEUE_WORKER_INFO Info
;
397 } EX_WORK_QUEUE
, *PEX_WORK_QUEUE
;
400 // Executive Fast Reference Structure
402 typedef struct _EX_FAST_REF
410 } EX_FAST_REF
, *PEX_FAST_REF
;
413 // Executive Cache-Aware Rundown Reference Descriptor
415 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
417 PEX_RUNDOWN_REF RunRefs
;
421 } EX_RUNDOWN_REF_CACHE_AWARE
;
424 // Executive Rundown Wait Block
426 typedef struct _EX_RUNDOWN_WAIT_BLOCK
430 } EX_RUNDOWN_WAIT_BLOCK
, *PEX_RUNDOWN_WAIT_BLOCK
;
433 // Executive Pushlock
437 typedef struct _EX_PUSH_LOCK
446 ULONG_PTR MultipleShared
:1;
447 ULONG_PTR Shared
:sizeof (ULONG_PTR
) * 8 - 4;
452 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
455 // Executive Pushlock Wait Block
457 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
464 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Next
;
465 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Last
;
466 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Previous
;
471 EX_PUSH_LOCK NewValue
;
472 EX_PUSH_LOCK OldValue
;
473 PEX_PUSH_LOCK PushLock
;
475 } EX_PUSH_LOCK_WAIT_BLOCK
, *PEX_PUSH_LOCK_WAIT_BLOCK
;
480 typedef struct _CALLBACK_OBJECT
484 LIST_ENTRY RegisteredCallbacks
;
485 BOOLEAN AllowMultipleCallbacks
;
492 typedef struct _CALLBACK_REGISTRATION
495 PCALLBACK_OBJECT CallbackObject
;
496 PCALLBACK_FUNCTION CallbackFunction
;
497 PVOID CallbackContext
;
499 BOOLEAN UnregisterWaiting
;
500 } CALLBACK_REGISTRATION
, *PCALLBACK_REGISTRATION
;
503 // Internal Callback Object
505 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
507 EX_RUNDOWN_REF RundownProtect
;
508 PEX_CALLBACK_FUNCTION Function
;
510 } EX_CALLBACK_ROUTINE_BLOCK
, *PEX_CALLBACK_ROUTINE_BLOCK
;
513 // Internal Callback Handle
515 typedef struct _EX_CALLBACK
517 EX_FAST_REF RoutineBlock
;
518 } EX_CALLBACK
, *PEX_CALLBACK
;
523 typedef struct _EPROFILE
531 PKPROFILE ProfileObject
;
532 PVOID LockedBufferAddress
;
535 KPROFILE_SOURCE ProfileSource
;
537 } EPROFILE
, *PEPROFILE
;
540 // Handle Table Structures
542 typedef struct _HANDLE_TRACE_DB_ENTRY
547 PVOID StackTrace
[16];
548 } HANDLE_TRACE_DB_ENTRY
, *PHANDLE_TRACE_DB_ENTRY
;
550 typedef struct _HANDLE_TRACE_DEBUG_INFO
555 FAST_MUTEX CloseCompatcionLock
;
556 ULONG CurrentStackIndex
;
557 HANDLE_TRACE_DB_ENTRY TraceDb
[1];
558 } HANDLE_TRACE_DEBUG_INFO
, *PHANDLE_TRACE_DEBUG_INFO
;
560 typedef struct _HANDLE_TABLE_ENTRY_INFO
563 } HANDLE_TABLE_ENTRY_INFO
, *PHANDLE_TABLE_ENTRY_INFO
;
565 typedef struct _HANDLE_TABLE_ENTRY
570 ULONG_PTR ObAttributes
;
571 PHANDLE_TABLE_ENTRY_INFO InfoTable
;
579 USHORT GrantedAccessIndex
;
580 USHORT CreatorBackTraceIndex
;
582 LONG NextFreeTableEntry
;
584 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
586 typedef struct _HANDLE_TABLE
588 #if (NTDDI_VERSION >= NTDDI_WINXP)
591 PHANDLE_TABLE_ENTRY
**Table
;
593 PEPROCESS QuotaProcess
;
594 PVOID UniqueProcessId
;
595 #if (NTDDI_VERSION >= NTDDI_WINXP)
596 EX_PUSH_LOCK HandleTableLock
[4];
597 LIST_ENTRY HandleTableList
;
598 EX_PUSH_LOCK HandleContentionEvent
;
600 ERESOURCE HandleLock
;
601 LIST_ENTRY HandleTableList
;
602 KEVENT HandleContentionEvent
;
604 PHANDLE_TRACE_DEBUG_INFO DebugInfo
;
606 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
612 LONG FirstFreeHandle
;
613 PHANDLE_TABLE_ENTRY LastFreeHandleEntry
;
615 ULONG NextHandleNeedingPool
;
619 ULONG NextHandleNeedingPool
;
627 } HANDLE_TABLE
, *PHANDLE_TABLE
;
632 // Hard Error LPC Message
634 typedef struct _HARDERROR_MSG
638 LARGE_INTEGER ErrorTime
;
639 ULONG ValidResponseOptions
;
641 ULONG NumberOfParameters
;
642 ULONG UnicodeStringParameterMask
;
643 ULONG Parameters
[MAXIMUM_HARDERROR_PARAMETERS
];
644 } HARDERROR_MSG
, *PHARDERROR_MSG
;
647 // Information Structures for NtQueryMutant
649 typedef struct _MUTANT_BASIC_INFORMATION
652 BOOLEAN OwnedByCaller
;
653 BOOLEAN AbandonedState
;
654 } MUTANT_BASIC_INFORMATION
, *PMUTANT_BASIC_INFORMATION
;
656 typedef struct _MUTANT_OWNER_INFORMATION
659 } MUTANT_OWNER_INFORMATION
, *PMUTANT_OWNER_INFORMATION
;
662 // Information Structures for NtQueryAtom
664 typedef struct _ATOM_BASIC_INFORMATION
670 } ATOM_BASIC_INFORMATION
, *PATOM_BASIC_INFORMATION
;
672 typedef struct _ATOM_TABLE_INFORMATION
676 } ATOM_TABLE_INFORMATION
, *PATOM_TABLE_INFORMATION
;
679 // Information Structures for NtQueryTimer
681 typedef struct _TIMER_BASIC_INFORMATION
683 LARGE_INTEGER TimeRemaining
;
685 } TIMER_BASIC_INFORMATION
, *PTIMER_BASIC_INFORMATION
;
688 // Information Structures for NtQuerySemaphore
690 typedef struct _SEMAPHORE_BASIC_INFORMATION
694 } SEMAPHORE_BASIC_INFORMATION
, *PSEMAPHORE_BASIC_INFORMATION
;
697 // Information Structures for NtQueryEvent
699 typedef struct _EVENT_BASIC_INFORMATION
701 EVENT_TYPE EventType
;
703 } EVENT_BASIC_INFORMATION
, *PEVENT_BASIC_INFORMATION
;
706 // Information Structures for NtQuerySystemInformation
708 typedef struct _SYSTEM_BASIC_INFORMATION
711 ULONG TimerResolution
;
713 ULONG NumberOfPhysicalPages
;
714 ULONG LowestPhysicalPageNumber
;
715 ULONG HighestPhysicalPageNumber
;
716 ULONG AllocationGranularity
;
717 ULONG_PTR MinimumUserModeAddress
;
718 ULONG_PTR MaximumUserModeAddress
;
719 ULONG_PTR ActiveProcessorsAffinityMask
;
720 CCHAR NumberOfProcessors
;
721 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
724 typedef struct _SYSTEM_PROCESSOR_INFORMATION
726 USHORT ProcessorArchitecture
;
727 USHORT ProcessorLevel
;
728 USHORT ProcessorRevision
;
730 ULONG ProcessorFeatureBits
;
731 } SYSTEM_PROCESSOR_INFORMATION
, *PSYSTEM_PROCESSOR_INFORMATION
;
734 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
736 LARGE_INTEGER IdleProcessTime
;
737 LARGE_INTEGER IoReadTransferCount
;
738 LARGE_INTEGER IoWriteTransferCount
;
739 LARGE_INTEGER IoOtherTransferCount
;
740 ULONG IoReadOperationCount
;
741 ULONG IoWriteOperationCount
;
742 ULONG IoOtherOperationCount
;
743 ULONG AvailablePages
;
744 ULONG CommittedPages
;
746 ULONG PeakCommitment
;
747 ULONG PageFaultCount
;
748 ULONG CopyOnWriteCount
;
749 ULONG TransitionCount
;
750 ULONG CacheTransitionCount
;
751 ULONG DemandZeroCount
;
753 ULONG PageReadIoCount
;
754 ULONG CacheReadCount
;
756 ULONG DirtyPagesWriteCount
;
757 ULONG DirtyWriteIoCount
;
758 ULONG MappedPagesWriteCount
;
759 ULONG MappedWriteIoCount
;
760 ULONG PagedPoolPages
;
761 ULONG NonPagedPoolPages
;
762 ULONG PagedPoolAllocs
;
763 ULONG PagedPoolFrees
;
764 ULONG NonPagedPoolAllocs
;
765 ULONG NonPagedPoolFrees
;
766 ULONG FreeSystemPtes
;
767 ULONG ResidentSystemCodePage
;
768 ULONG TotalSystemDriverPages
;
769 ULONG TotalSystemCodePages
;
770 ULONG NonPagedPoolLookasideHits
;
771 ULONG PagedPoolLookasideHits
;
773 ULONG ResidentSystemCachePage
;
774 ULONG ResidentPagedPoolPage
;
775 ULONG ResidentSystemDriverPage
;
776 ULONG CcFastReadNoWait
;
777 ULONG CcFastReadWait
;
778 ULONG CcFastReadResourceMiss
;
779 ULONG CcFastReadNotPossible
;
780 ULONG CcFastMdlReadNoWait
;
781 ULONG CcFastMdlReadWait
;
782 ULONG CcFastMdlReadResourceMiss
;
783 ULONG CcFastMdlReadNotPossible
;
784 ULONG CcMapDataNoWait
;
786 ULONG CcMapDataNoWaitMiss
;
787 ULONG CcMapDataWaitMiss
;
788 ULONG CcPinMappedDataCount
;
789 ULONG CcPinReadNoWait
;
791 ULONG CcPinReadNoWaitMiss
;
792 ULONG CcPinReadWaitMiss
;
793 ULONG CcCopyReadNoWait
;
794 ULONG CcCopyReadWait
;
795 ULONG CcCopyReadNoWaitMiss
;
796 ULONG CcCopyReadWaitMiss
;
797 ULONG CcMdlReadNoWait
;
799 ULONG CcMdlReadNoWaitMiss
;
800 ULONG CcMdlReadWaitMiss
;
801 ULONG CcReadAheadIos
;
802 ULONG CcLazyWriteIos
;
803 ULONG CcLazyWritePages
;
806 ULONG ContextSwitches
;
807 ULONG FirstLevelTbFills
;
808 ULONG SecondLevelTbFills
;
810 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
813 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
815 LARGE_INTEGER BootTime
;
816 LARGE_INTEGER CurrentTime
;
817 LARGE_INTEGER TimeZoneBias
;
820 #if (NTDDI_VERSION >= NTDDI_WIN2K)
821 ULONGLONG BootTimeBias
;
822 ULONGLONG SleepTimeBias
;
824 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
827 // This class is obsolete, please use KUSER_SHARED_DATA instead
830 typedef struct _SYSTEM_THREAD_INFORMATION
832 LARGE_INTEGER KernelTime
;
833 LARGE_INTEGER UserTime
;
834 LARGE_INTEGER CreateTime
;
840 ULONG ContextSwitches
;
843 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
845 typedef struct _SYSTEM_PROCESS_INFORMATION
847 ULONG NextEntryOffset
;
848 ULONG NumberOfThreads
;
849 LARGE_INTEGER SpareLi1
;
850 LARGE_INTEGER SpareLi2
;
851 LARGE_INTEGER SpareLi3
;
852 LARGE_INTEGER CreateTime
;
853 LARGE_INTEGER UserTime
;
854 LARGE_INTEGER KernelTime
;
855 UNICODE_STRING ImageName
;
856 KPRIORITY BasePriority
;
857 HANDLE UniqueProcessId
;
858 HANDLE InheritedFromUniqueProcessId
;
861 ULONG_PTR PageDirectoryBase
;
864 // This part corresponds to VM_COUNTERS_EX.
865 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
867 SIZE_T PeakVirtualSize
;
869 SIZE_T PageFaultCount
;
870 SIZE_T PeakWorkingSetSize
;
871 SIZE_T WorkingSetSize
;
872 SIZE_T QuotaPeakPagedPoolUsage
;
873 SIZE_T QuotaPagedPoolUsage
;
874 SIZE_T QuotaPeakNonPagedPoolUsage
;
875 SIZE_T QuotaNonPagedPoolUsage
;
876 SIZE_T PagefileUsage
;
877 SIZE_T PeakPagefileUsage
;
878 SIZE_T PrivatePageCount
;
881 // This part corresponds to IO_COUNTERS
883 LARGE_INTEGER ReadOperationCount
;
884 LARGE_INTEGER WriteOperationCount
;
885 LARGE_INTEGER OtherOperationCount
;
886 LARGE_INTEGER ReadTransferCount
;
887 LARGE_INTEGER WriteTransferCount
;
888 LARGE_INTEGER OtherTransferCount
;
890 //SYSTEM_THREAD_INFORMATION TH[1];
891 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
894 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
897 ULONG NumberOfTables
;
898 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
901 typedef struct _SYSTEM_DEVICE_INFORMATION
904 ULONG NumberOfFloppies
;
905 ULONG NumberOfCdRoms
;
907 ULONG NumberOfSerialPorts
;
908 ULONG NumberOfParallelPorts
;
909 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
912 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
914 LARGE_INTEGER IdleTime
;
915 LARGE_INTEGER KernelTime
;
916 LARGE_INTEGER UserTime
;
917 LARGE_INTEGER DpcTime
;
918 LARGE_INTEGER InterruptTime
;
919 ULONG InterruptCount
;
920 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
923 typedef struct _SYSTEM_FLAGS_INFORMATION
926 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
929 typedef struct _SYSTEM_CALL_TIME_INFORMATION
933 LARGE_INTEGER TimeOfCalls
[1];
934 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
936 // Class 11 - See RTL_PROCESS_MODULES
938 // Class 12 - See RTL_PROCESS_LOCKS
940 // Class 13 - See RTL_PROCESS_BACKTRACES
943 typedef struct _SYSTEM_POOL_ENTRY
947 USHORT AllocatorBackTraceIndex
;
953 PVOID ProcessChargedQuota
;
955 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
957 typedef struct _SYSTEM_POOL_INFORMATION
961 USHORT EntryOverhead
;
962 BOOLEAN PoolTagPresent
;
964 ULONG NumberOfEntries
;
965 SYSTEM_POOL_ENTRY Entries
[1];
966 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
969 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
971 USHORT UniqueProcessId
;
972 USHORT CreatorBackTraceIndex
;
973 UCHAR ObjectTypeIndex
;
974 UCHAR HandleAttributes
;
978 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
980 typedef struct _SYSTEM_HANDLE_INFORMATION
982 ULONG NumberOfHandles
;
983 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
984 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
987 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
989 ULONG NextEntryOffset
;
990 ULONG NumberOfObjects
;
991 ULONG NumberOfHandles
;
993 ULONG InvalidAttributes
;
994 GENERIC_MAPPING GenericMapping
;
995 ULONG ValidAccessMask
;
997 BOOLEAN SecurityRequired
;
998 BOOLEAN WaitableObject
;
999 UNICODE_STRING TypeName
;
1000 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
1002 typedef struct _SYSTEM_OBJECT_INFORMATION
1004 ULONG NextEntryOffset
;
1006 HANDLE CreatorUniqueProcess
;
1007 USHORT CreatorBackTraceIndex
;
1011 ULONG PagedPoolCharge
;
1012 ULONG NonPagedPoolCharge
;
1013 HANDLE ExclusiveProcessId
;
1014 PVOID SecurityDescriptor
;
1015 OBJECT_NAME_INFORMATION NameInfo
;
1016 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
1019 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1021 ULONG NextEntryOffset
;
1025 UNICODE_STRING PageFileName
;
1026 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
1029 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1031 ULONG SegmentNotPresent
;
1033 ULONG OpcodeESPrefix
;
1034 ULONG OpcodeCSPrefix
;
1035 ULONG OpcodeSSPrefix
;
1036 ULONG OpcodeDSPrefix
;
1037 ULONG OpcodeFSPrefix
;
1038 ULONG OpcodeGSPrefix
;
1039 ULONG OpcodeOPER32Prefix
;
1040 ULONG OpcodeADDR32Prefix
;
1052 ULONG OpcodeOUTBimm
;
1053 ULONG OpcodeOUTWimm
;
1058 ULONG OpcodeLOCKPrefix
;
1059 ULONG OpcodeREPNEPrefix
;
1060 ULONG OpcodeREPPrefix
;
1065 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
1067 // Class 20 - ULONG VDMBOPINFO
1070 typedef struct _SYSTEM_FILECACHE_INFORMATION
1074 ULONG PageFaultCount
;
1075 ULONG MinimumWorkingSet
;
1076 ULONG MaximumWorkingSet
;
1077 ULONG CurrentSizeIncludingTransitionInPages
;
1078 ULONG PeakSizeIncludingTransitionInPages
;
1079 ULONG TransitionRePurposeCount
;
1081 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1084 typedef struct _SYSTEM_POOLTAG
1094 ULONG NonPagedAllocs
;
1095 ULONG NonPagedFrees
;
1097 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1098 typedef struct _SYSTEM_POOLTAG_INFORMATION
1101 SYSTEM_POOLTAG TagInfo
[1];
1102 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1105 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1107 ULONG ContextSwitches
;
1110 ULONG TimeIncrement
;
1111 ULONG DpcBypassCount
;
1112 ULONG ApcBypassCount
;
1113 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1116 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1119 ULONG DpcQueueDepth
;
1120 ULONG MinimumDpcRate
;
1121 ULONG AdjustDpcThreshold
;
1123 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1126 typedef struct _SYSTEM_MEMORY_INFO
1128 PUCHAR StringOffset
;
1130 USHORT TransitionCount
;
1131 USHORT ModifiedCount
;
1132 USHORT PageTableCount
;
1133 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1135 typedef struct _SYSTEM_MEMORY_INFORMATION
1139 SYSTEM_MEMORY_INFO Memory
[1];
1140 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1143 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1145 UNICODE_STRING DriverName
;
1147 PVOID SectionPointer
;
1149 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1151 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1154 // Not an actually class, simply a PVOID to the ImageAddress
1157 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1159 ULONG TimeAdjustment
;
1160 ULONG TimeIncrement
;
1162 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1164 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1166 ULONG TimeAdjustment
;
1168 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1170 // Class 29 - Same as 25
1175 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1178 UCHAR TracePermanent
;
1179 UNICODE_STRING TraceProcessName
;
1180 UNICODE_STRING TracePoolTags
;
1181 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1183 // Class 32 - OBSOLETE
1186 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1188 ULONG AlignmentFixupCount
;
1189 ULONG ExceptionDispatchCount
;
1190 ULONG FloatingEmulationCount
;
1191 ULONG ByteWordEmulationCount
;
1192 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1195 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1197 ULONG ValidCrashDump
;
1198 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1201 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1203 BOOLEAN KernelDebuggerEnabled
;
1204 BOOLEAN KernelDebuggerNotPresent
;
1205 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1208 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1210 ULONG ContextSwitches
;
1219 ULONG PreemptCurrent
;
1222 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1225 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1227 ULONG RegistryQuotaAllowed
;
1228 ULONG RegistryQuotaUsed
;
1229 ULONG PagedPoolSize
;
1230 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1233 // Not a structure, simply send the UNICODE_STRING
1236 // Not a structure, simply send a ULONG containing the new separation
1239 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1242 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1243 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1246 typedef struct _SYSTEM_DOCK_INFORMATION
1248 SYSTEM_DOCK_STATE DockState
;
1249 INTERFACE_TYPE DeviceBusType
;
1250 ULONG DeviceBusNumber
;
1252 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1255 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1257 BOOLEAN SystemSuspendSupported
;
1258 BOOLEAN SystemHibernateSupported
;
1259 BOOLEAN ResumeTimerSupportsSuspend
;
1260 BOOLEAN ResumeTimerSupportsHibernate
;
1261 BOOLEAN LidSupported
;
1262 BOOLEAN TurboSettingSupported
;
1264 BOOLEAN SystemAcOrDc
;
1265 BOOLEAN PowerDownDisabled
;
1266 LARGE_INTEGER SpindownDrives
;
1267 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1270 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1272 PNP_VETO_TYPE VetoType
;
1273 UNICODE_STRING VetoDriver
;
1275 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1278 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1281 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1283 USHORT CurrentDepth
;
1284 USHORT MaximumDepth
;
1285 ULONG TotalAllocates
;
1286 ULONG AllocateMisses
;
1292 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1295 // Not a structure. Only a HANDLE for the SlipEvent;
1298 // Not a structure. Only a ULONG for the SessionId;
1301 // Not a structure. Only a ULONG for the SessionId;
1306 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1309 typedef struct _SYSTEM_VERIFIER_INFORMATION
1311 ULONG NextEntryOffset
;
1313 UNICODE_STRING DriverName
;
1315 ULONG AcquireSpinLocks
;
1316 ULONG SynchronizeExecutions
;
1317 ULONG AllocationsAttempted
;
1318 ULONG AllocationsSucceeded
;
1319 ULONG AllocationsSucceededSpecialPool
;
1320 ULONG AllocationsWithNoTag
;
1323 ULONG AllocationsFailed
;
1324 ULONG AllocationsFailedDeliberately
;
1327 ULONG UnTrackedPool
;
1328 ULONG CurrentPagedPoolAllocations
;
1329 ULONG CurrentNonPagedPoolAllocations
;
1330 ULONG PeakPagedPoolAllocations
;
1331 ULONG PeakNonPagedPoolAllocations
;
1332 ULONG PagedPoolUsageInBytes
;
1333 ULONG NonPagedPoolUsageInBytes
;
1334 ULONG PeakPagedPoolUsageInBytes
;
1335 ULONG PeakNonPagedPoolUsageInBytes
;
1336 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1341 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1345 PVOID Buffer
; // Same format as in SystemProcessInformation
1346 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1348 // FIXME: Class 54-97
1353 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1354 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1355 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1356 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1357 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1358 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1362 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1381 USHORT TargetNameOffset
;
1382 USHORT TargetNameLength
;
1383 UCHAR PatchingFinished
;
1389 USHORT TargetNameOffset
;
1390 USHORT TargetNameLength
;
1391 UCHAR PatchingFinished
;
1392 NTSTATUS ReturnCode
;
1393 HANDLE TargetProcess
;
1398 PIO_STATUS_BLOCK IoStatusBlock1
;
1399 PVOID RenameInformation1
;
1400 PVOID RenameInformationLength1
;
1402 PIO_STATUS_BLOCK IoStatusBlock2
;
1403 PVOID RenameInformation2
;
1404 PVOID RenameInformationLength2
;
1408 HANDLE ParentDirectory
;
1409 HANDLE ObjectHandle1
;
1410 HANDLE ObjectHandle2
;
1413 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1418 #ifdef NTOS_MODE_USER
1419 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1421 ULONG ProviderSignature
;
1423 PFNFTH FirmwareTableHandler
;
1425 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1430 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1432 ULONG ProviderSignature
;
1433 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1435 ULONG TableBufferLength
;
1436 UCHAR TableBuffer
[1];
1437 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;
1442 typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
1444 SIZE_T ZeroPageCount
;
1445 SIZE_T FreePageCount
;
1446 SIZE_T ModifiedPageCount
;
1447 SIZE_T ModifiedNoWritePageCount
;
1448 SIZE_T BadPageCount
;
1449 SIZE_T PageCountByPriority
[8];
1450 SIZE_T RepurposedPagesByPriority
[8];
1451 } SYSTEM_MEMORY_LIST_INFORMATION
, *PSYSTEM_MEMORY_LIST_INFORMATION
;