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
, *PEX_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 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
823 // This class is obsolete, please use KUSER_SHARED_DATA instead
826 typedef struct _SYSTEM_THREAD_INFORMATION
828 LARGE_INTEGER KernelTime
;
829 LARGE_INTEGER UserTime
;
830 LARGE_INTEGER CreateTime
;
836 ULONG ContextSwitches
;
839 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
841 typedef struct _SYSTEM_PROCESS_INFORMATION
843 ULONG NextEntryOffset
;
844 ULONG NumberOfThreads
;
845 LARGE_INTEGER SpareLi1
;
846 LARGE_INTEGER SpareLi2
;
847 LARGE_INTEGER SpareLi3
;
848 LARGE_INTEGER CreateTime
;
849 LARGE_INTEGER UserTime
;
850 LARGE_INTEGER KernelTime
;
851 UNICODE_STRING ImageName
;
852 KPRIORITY BasePriority
;
853 HANDLE UniqueProcessId
;
854 HANDLE InheritedFromUniqueProcessId
;
857 ULONG_PTR PageDirectoryBase
;
860 // This part corresponds to VM_COUNTERS_EX.
861 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
863 SIZE_T PeakVirtualSize
;
865 SIZE_T PageFaultCount
;
866 SIZE_T PeakWorkingSetSize
;
867 SIZE_T WorkingSetSize
;
868 SIZE_T QuotaPeakPagedPoolUsage
;
869 SIZE_T QuotaPagedPoolUsage
;
870 SIZE_T QuotaPeakNonPagedPoolUsage
;
871 SIZE_T QuotaNonPagedPoolUsage
;
872 SIZE_T PagefileUsage
;
873 SIZE_T PeakPagefileUsage
;
874 SIZE_T PrivatePageCount
;
877 // This part corresponds to IO_COUNTERS
879 LARGE_INTEGER ReadOperationCount
;
880 LARGE_INTEGER WriteOperationCount
;
881 LARGE_INTEGER OtherOperationCount
;
882 LARGE_INTEGER ReadTransferCount
;
883 LARGE_INTEGER WriteTransferCount
;
884 LARGE_INTEGER OtherTransferCount
;
886 //SYSTEM_THREAD_INFORMATION TH[1];
887 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
890 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
893 ULONG NumberOfTables
;
894 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
897 typedef struct _SYSTEM_DEVICE_INFORMATION
900 ULONG NumberOfFloppies
;
901 ULONG NumberOfCdRoms
;
903 ULONG NumberOfSerialPorts
;
904 ULONG NumberOfParallelPorts
;
905 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
908 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
910 LARGE_INTEGER IdleTime
;
911 LARGE_INTEGER KernelTime
;
912 LARGE_INTEGER UserTime
;
913 LARGE_INTEGER DpcTime
;
914 LARGE_INTEGER InterruptTime
;
915 ULONG InterruptCount
;
916 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
919 typedef struct _SYSTEM_FLAGS_INFORMATION
922 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
925 typedef struct _SYSTEM_CALL_TIME_INFORMATION
929 LARGE_INTEGER TimeOfCalls
[1];
930 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
932 // Class 11 - See RTL_PROCESS_MODULES
934 // Class 12 - See RTL_PROCESS_LOCKS
936 // Class 13 - See RTL_PROCESS_BACKTRACES
939 typedef struct _SYSTEM_POOL_ENTRY
943 USHORT AllocatorBackTraceIndex
;
949 PVOID ProcessChargedQuota
;
951 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
953 typedef struct _SYSTEM_POOL_INFORMATION
957 USHORT EntryOverhead
;
958 BOOLEAN PoolTagPresent
;
960 ULONG NumberOfEntries
;
961 SYSTEM_POOL_ENTRY Entries
[1];
962 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
965 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
967 USHORT UniqueProcessId
;
968 USHORT CreatorBackTraceIndex
;
969 UCHAR ObjectTypeIndex
;
970 UCHAR HandleAttributes
;
974 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
976 typedef struct _SYSTEM_HANDLE_INFORMATION
978 ULONG NumberOfHandles
;
979 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
980 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
983 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
985 ULONG NextEntryOffset
;
986 ULONG NumberOfObjects
;
987 ULONG NumberOfHandles
;
989 ULONG InvalidAttributes
;
990 GENERIC_MAPPING GenericMapping
;
991 ULONG ValidAccessMask
;
993 BOOLEAN SecurityRequired
;
994 BOOLEAN WaitableObject
;
995 UNICODE_STRING TypeName
;
996 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
998 typedef struct _SYSTEM_OBJECT_INFORMATION
1000 ULONG NextEntryOffset
;
1002 HANDLE CreatorUniqueProcess
;
1003 USHORT CreatorBackTraceIndex
;
1007 ULONG PagedPoolCharge
;
1008 ULONG NonPagedPoolCharge
;
1009 HANDLE ExclusiveProcessId
;
1010 PVOID SecurityDescriptor
;
1011 OBJECT_NAME_INFORMATION NameInfo
;
1012 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
1015 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1017 ULONG NextEntryOffset
;
1021 UNICODE_STRING PageFileName
;
1022 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
1025 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1027 ULONG SegmentNotPresent
;
1029 ULONG OpcodeESPrefix
;
1030 ULONG OpcodeCSPrefix
;
1031 ULONG OpcodeSSPrefix
;
1032 ULONG OpcodeDSPrefix
;
1033 ULONG OpcodeFSPrefix
;
1034 ULONG OpcodeGSPrefix
;
1035 ULONG OpcodeOPER32Prefix
;
1036 ULONG OpcodeADDR32Prefix
;
1048 ULONG OpcodeOUTBimm
;
1049 ULONG OpcodeOUTWimm
;
1054 ULONG OpcodeLOCKPrefix
;
1055 ULONG OpcodeREPNEPrefix
;
1056 ULONG OpcodeREPPrefix
;
1061 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
1063 // Class 20 - ULONG VDMBOPINFO
1066 typedef struct _SYSTEM_FILECACHE_INFORMATION
1070 ULONG PageFaultCount
;
1071 ULONG MinimumWorkingSet
;
1072 ULONG MaximumWorkingSet
;
1073 ULONG CurrentSizeIncludingTransitionInPages
;
1074 ULONG PeakSizeIncludingTransitionInPages
;
1075 ULONG TransitionRePurposeCount
;
1077 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1080 typedef struct _SYSTEM_POOLTAG
1090 ULONG NonPagedAllocs
;
1091 ULONG NonPagedFrees
;
1093 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1094 typedef struct _SYSTEM_POOLTAG_INFORMATION
1097 SYSTEM_POOLTAG TagInfo
[1];
1098 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1101 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1103 ULONG ContextSwitches
;
1106 ULONG TimeIncrement
;
1107 ULONG DpcBypassCount
;
1108 ULONG ApcBypassCount
;
1109 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1112 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1115 ULONG DpcQueueDepth
;
1116 ULONG MinimumDpcRate
;
1117 ULONG AdjustDpcThreshold
;
1119 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1122 typedef struct _SYSTEM_MEMORY_INFO
1124 PUCHAR StringOffset
;
1126 USHORT TransitionCount
;
1127 USHORT ModifiedCount
;
1128 USHORT PageTableCount
;
1129 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1131 typedef struct _SYSTEM_MEMORY_INFORMATION
1135 SYSTEM_MEMORY_INFO Memory
[1];
1136 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1139 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1141 UNICODE_STRING DriverName
;
1143 PVOID SectionPointer
;
1145 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1147 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1150 // Not an actually class, simply a PVOID to the ImageAddress
1153 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1155 ULONG TimeAdjustment
;
1156 ULONG TimeIncrement
;
1158 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1160 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1162 ULONG TimeAdjustment
;
1164 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1166 // Class 29 - Same as 25
1171 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1174 UCHAR TracePermanent
;
1175 UNICODE_STRING TraceProcessName
;
1176 UNICODE_STRING TracePoolTags
;
1177 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1179 // Class 32 - OBSOLETE
1182 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1184 ULONG AlignmentFixupCount
;
1185 ULONG ExceptionDispatchCount
;
1186 ULONG FloatingEmulationCount
;
1187 ULONG ByteWordEmulationCount
;
1188 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1191 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1193 ULONG ValidCrashDump
;
1194 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1197 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1199 BOOLEAN KernelDebuggerEnabled
;
1200 BOOLEAN KernelDebuggerNotPresent
;
1201 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1204 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1206 ULONG ContextSwitches
;
1215 ULONG PreemptCurrent
;
1218 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1221 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1223 ULONG RegistryQuotaAllowed
;
1224 ULONG RegistryQuotaUsed
;
1225 ULONG PagedPoolSize
;
1226 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1229 // Not a structure, simply send the UNICODE_STRING
1232 // Not a structure, simply send a ULONG containing the new separation
1235 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1238 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1239 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1242 typedef struct _SYSTEM_DOCK_INFORMATION
1244 SYSTEM_DOCK_STATE DockState
;
1245 INTERFACE_TYPE DeviceBusType
;
1246 ULONG DeviceBusNumber
;
1248 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1251 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1253 BOOLEAN SystemSuspendSupported
;
1254 BOOLEAN SystemHibernateSupported
;
1255 BOOLEAN ResumeTimerSupportsSuspend
;
1256 BOOLEAN ResumeTimerSupportsHibernate
;
1257 BOOLEAN LidSupported
;
1258 BOOLEAN TurboSettingSupported
;
1260 BOOLEAN SystemAcOrDc
;
1261 BOOLEAN PowerDownDisabled
;
1262 LARGE_INTEGER SpindownDrives
;
1263 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1266 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1268 PNP_VETO_TYPE VetoType
;
1269 UNICODE_STRING VetoDriver
;
1271 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1274 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1277 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1279 USHORT CurrentDepth
;
1280 USHORT MaximumDepth
;
1281 ULONG TotalAllocates
;
1282 ULONG AllocateMisses
;
1288 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1291 // Not a structure. Only a HANDLE for the SlipEvent;
1294 // Not a structure. Only a ULONG for the SessionId;
1297 // Not a structure. Only a ULONG for the SessionId;
1302 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1305 typedef struct _SYSTEM_VERIFIER_INFORMATION
1307 ULONG NextEntryOffset
;
1309 UNICODE_STRING DriverName
;
1311 ULONG AcquireSpinLocks
;
1312 ULONG SynchronizeExecutions
;
1313 ULONG AllocationsAttempted
;
1314 ULONG AllocationsSucceeded
;
1315 ULONG AllocationsSucceededSpecialPool
;
1316 ULONG AllocationsWithNoTag
;
1319 ULONG AllocationsFailed
;
1320 ULONG AllocationsFailedDeliberately
;
1323 ULONG UnTrackedPool
;
1324 ULONG CurrentPagedPoolAllocations
;
1325 ULONG CurrentNonPagedPoolAllocations
;
1326 ULONG PeakPagedPoolAllocations
;
1327 ULONG PeakNonPagedPoolAllocations
;
1328 ULONG PagedPoolUsageInBytes
;
1329 ULONG NonPagedPoolUsageInBytes
;
1330 ULONG PeakPagedPoolUsageInBytes
;
1331 ULONG PeakNonPagedPoolUsageInBytes
;
1332 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1337 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1341 PVOID Buffer
; // Same format as in SystemProcessInformation
1342 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1344 // FIXME: Class 54-97
1349 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1350 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1351 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1352 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1353 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1354 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1358 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1377 USHORT TargetNameOffset
;
1378 USHORT TargetNameLength
;
1379 UCHAR PatchingFinished
;
1385 USHORT TargetNameOffset
;
1386 USHORT TargetNameLength
;
1387 UCHAR PatchingFinished
;
1388 NTSTATUS ReturnCode
;
1389 HANDLE TargetProcess
;
1394 PIO_STATUS_BLOCK IoStatusBlock1
;
1395 PVOID RenameInformation1
;
1396 PVOID RenameInformationLength1
;
1398 PIO_STATUS_BLOCK IoStatusBlock2
;
1399 PVOID RenameInformation2
;
1400 PVOID RenameInformationLength2
;
1404 HANDLE ParentDirectory
;
1405 HANDLE ObjectHandle1
;
1406 HANDLE ObjectHandle2
;
1409 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1414 #ifdef NTOS_MODE_USER
1415 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1417 ULONG ProviderSignature
;
1419 PFNFTH FirmwareTableHandler
;
1421 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1426 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1428 ULONG ProviderSignature
;
1429 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1431 ULONG TableBufferLength
;
1432 UCHAR TableBuffer
[1];
1433 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;
1438 typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
1440 SIZE_T ZeroPageCount
;
1441 SIZE_T FreePageCount
;
1442 SIZE_T ModifiedPageCount
;
1443 SIZE_T ModifiedNoWritePageCount
;
1444 SIZE_T BadPageCount
;
1445 SIZE_T PageCountByPriority
[8];
1446 SIZE_T RepurposedPagesByPriority
[8];
1447 } SYSTEM_MEMORY_LIST_INFORMATION
, *PSYSTEM_MEMORY_LIST_INFORMATION
;