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 NTSYSAPI 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_MODIFY_STATE 0x0001
86 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
88 CALLBACK_MODIFY_STATE)
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 // NtRaiseHardError-related parameters
132 #define MAXIMUM_HARDERROR_PARAMETERS 4
133 #define HARDERROR_OVERRIDE_ERRORMODE 0x10000000
138 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
139 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
140 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
141 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
142 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
143 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
144 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
147 // Pushlock Wait Block Flags
149 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
150 #define EX_PUSH_LOCK_FLAGS_WAIT_V 1
151 #define EX_PUSH_LOCK_FLAGS_WAIT 2
154 // Resource (ERESOURCE) Flags
156 #define ResourceHasDisabledPriorityBoost 0x08
159 // Shutdown types for NtShutdownSystem
161 typedef enum _SHUTDOWN_ACTION
169 // Responses for NtRaiseHardError
171 typedef enum _HARDERROR_RESPONSE_OPTION
173 OptionAbortRetryIgnore
,
179 OptionShutdownSystem
,
181 OptionCancelTryContinue
182 } HARDERROR_RESPONSE_OPTION
, *PHARDERROR_RESPONSE_OPTION
;
184 typedef enum _HARDERROR_RESPONSE
186 ResponseReturnToCaller
,
197 } HARDERROR_RESPONSE
, *PHARDERROR_RESPONSE
;
200 // System Information Classes for NtQuerySystemInformation
202 typedef enum _SYSTEM_INFORMATION_CLASS
204 SystemBasicInformation
,
205 SystemProcessorInformation
,
206 SystemPerformanceInformation
,
207 SystemTimeOfDayInformation
,
208 SystemPathInformation
, /// Obsolete: Use KUSER_SHARED_DATA
209 SystemProcessInformation
,
210 SystemCallCountInformation
,
211 SystemDeviceInformation
,
212 SystemProcessorPerformanceInformation
,
213 SystemFlagsInformation
,
214 SystemCallTimeInformation
,
215 SystemModuleInformation
,
216 SystemLocksInformation
,
217 SystemStackTraceInformation
,
218 SystemPagedPoolInformation
,
219 SystemNonPagedPoolInformation
,
220 SystemHandleInformation
,
221 SystemObjectInformation
,
222 SystemPageFileInformation
,
223 SystemVdmInstemulInformation
,
224 SystemVdmBopInformation
,
225 SystemFileCacheInformation
,
226 SystemPoolTagInformation
,
227 SystemInterruptInformation
,
228 SystemDpcBehaviorInformation
,
229 SystemFullMemoryInformation
,
230 SystemLoadGdiDriverInformation
,
231 SystemUnloadGdiDriverInformation
,
232 SystemTimeAdjustmentInformation
,
233 SystemSummaryMemoryInformation
,
234 SystemMirrorMemoryInformation
,
235 SystemPerformanceTraceInformation
,
237 SystemExceptionInformation
,
238 SystemCrashDumpStateInformation
,
239 SystemKernelDebuggerInformation
,
240 SystemContextSwitchInformation
,
241 SystemRegistryQuotaInformation
,
242 SystemExtendServiceTableInformation
,
243 SystemPrioritySeperation
,
244 SystemPlugPlayBusInformation
,
245 SystemDockInformation
,
246 SystemPowerInformationNative
,
247 SystemProcessorSpeedInformation
,
248 SystemCurrentTimeZoneInformation
,
249 SystemLookasideInformation
,
250 SystemTimeSlipNotification
,
253 SystemSessionInformation
,
254 SystemRangeStartInformation
,
255 SystemVerifierInformation
,
257 SystemSessionProcessesInformation
,
258 SystemLoadGdiDriverInSystemSpaceInformation
,
259 SystemNumaProcessorMap
,
260 SystemPrefetcherInformation
,
261 SystemExtendedProcessInformation
,
262 SystemRecommendedSharedDataAlignment
,
263 SystemComPlusPackage
,
264 SystemNumaAvailableMemory
,
265 SystemProcessorPowerInformation
,
266 SystemEmulationBasicInformation
,
267 SystemEmulationProcessorInformation
,
268 SystemExtendedHanfleInformation
,
269 SystemLostDelayedWriteInformation
,
270 SystemBigPoolInformation
,
271 SystemSessionPoolTagInformation
,
272 SystemSessionMappedViewInformation
,
273 SystemHotpatchInformation
,
274 SystemObjectSecurityMode
,
275 SystemWatchDogTimerHandler
,
276 SystemWatchDogTimerInformation
,
277 SystemLogicalProcessorInformation
,
278 SystemWow64SharedInformationObsolete
,
279 SystemRegisterFirmwareTableInformationHandler
,
280 SystemFirmwareTableInformation
,
281 SystemModuleInformationEx
,
282 SystemVerifierTriageInformation
,
283 SystemSuperfetchInformation
,
284 SystemMemoryListInformation
,
285 SystemFileCacheInformationEx
,
286 SystemThreadPriorityClientIdInformation
,
287 SystemProcessorIdleCycleTimeInformation
,
288 SystemVerifierCancellationInformation
,
289 SystemProcessorPowerInformationEx
,
290 SystemRefTraceInformation
,
291 SystemSpecialPoolInformation
,
292 SystemProcessIdInformation
,
293 SystemErrorPortInformation
,
294 SystemBootEnvironmentInformation
,
295 SystemHypervisorInformation
,
296 SystemVerifierInformationEx
,
297 SystemTimeZoneInformation
,
298 SystemImageFileExecutionOptionsInformation
,
299 SystemCoverageInformation
,
300 SystemPrefetchPathInformation
,
301 SystemVerifierFaultsInformation
,
303 } SYSTEM_INFORMATION_CLASS
;
306 // System Information Classes for NtQueryMutant
308 typedef enum _MUTANT_INFORMATION_CLASS
310 MutantBasicInformation
,
311 MutantOwnerInformation
312 } MUTANT_INFORMATION_CLASS
;
315 // System Information Classes for NtQueryAtom
317 typedef enum _ATOM_INFORMATION_CLASS
319 AtomBasicInformation
,
320 AtomTableInformation
,
321 } ATOM_INFORMATION_CLASS
;
324 // System Information Classes for NtQueryTimer
326 typedef enum _TIMER_INFORMATION_CLASS
328 TimerBasicInformation
329 } TIMER_INFORMATION_CLASS
;
332 // System Information Classes for NtQuerySemaphore
334 typedef enum _SEMAPHORE_INFORMATION_CLASS
336 SemaphoreBasicInformation
337 } SEMAPHORE_INFORMATION_CLASS
;
340 // System Information Classes for NtQueryEvent
342 typedef enum _EVENT_INFORMATION_CLASS
344 EventBasicInformation
345 } EVENT_INFORMATION_CLASS
;
347 #ifdef NTOS_MODE_USER
350 // Firmware Table Actions for SystemFirmwareTableInformation
352 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
354 SystemFirmwareTable_Enumerate
= 0,
355 SystemFirmwareTable_Get
= 1,
356 } SYSTEM_FIRMWARE_TABLE_ACTION
, *PSYSTEM_FIRMWARE_TABLE_ACTION
;
359 // Firmware Handler Callback
361 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
;
365 IN
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
*FirmwareTableInformation
371 // Handle Enumeration Callback
373 struct _HANDLE_TABLE_ENTRY
;
375 (NTAPI
*PEX_ENUM_HANDLE_CALLBACK
)(
376 IN
struct _HANDLE_TABLE_ENTRY
*HandleTableEntry
,
382 // Executive Work Queue Structures
384 typedef struct _EX_QUEUE_WORKER_INFO
386 ULONG QueueDisabled
:1;
387 ULONG MakeThreadsAsNecessary
:1;
389 ULONG WorkerCount
:29;
390 } EX_QUEUE_WORKER_INFO
, *PEX_QUEUE_WORKER_INFO
;
392 typedef struct _EX_WORK_QUEUE
395 LONG DynamicThreadCount
;
396 ULONG WorkItemsProcessed
;
397 ULONG WorkItemsProcessedLastPass
;
398 ULONG QueueDepthLastPass
;
399 EX_QUEUE_WORKER_INFO Info
;
400 } EX_WORK_QUEUE
, *PEX_WORK_QUEUE
;
403 // Executive Fast Reference Structure
405 typedef struct _EX_FAST_REF
413 } EX_FAST_REF
, *PEX_FAST_REF
;
416 // Executive Cache-Aware Rundown Reference Descriptor
418 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
420 PEX_RUNDOWN_REF RunRefs
;
424 } EX_RUNDOWN_REF_CACHE_AWARE
;
427 // Executive Rundown Wait Block
429 typedef struct _EX_RUNDOWN_WAIT_BLOCK
433 } EX_RUNDOWN_WAIT_BLOCK
, *PEX_RUNDOWN_WAIT_BLOCK
;
436 // Executive Pushlock
440 typedef struct _EX_PUSH_LOCK
449 ULONG_PTR MultipleShared
:1;
450 ULONG_PTR Shared
:sizeof (ULONG_PTR
) * 8 - 4;
455 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
458 // Executive Pushlock Wait Block
460 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
467 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Next
;
468 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Last
;
469 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Previous
;
474 EX_PUSH_LOCK NewValue
;
475 EX_PUSH_LOCK OldValue
;
476 PEX_PUSH_LOCK PushLock
;
478 } EX_PUSH_LOCK_WAIT_BLOCK
, *PEX_PUSH_LOCK_WAIT_BLOCK
;
483 typedef struct _CALLBACK_OBJECT
487 LIST_ENTRY RegisteredCallbacks
;
488 BOOLEAN AllowMultipleCallbacks
;
495 typedef struct _CALLBACK_REGISTRATION
498 PCALLBACK_OBJECT CallbackObject
;
499 PCALLBACK_FUNCTION CallbackFunction
;
500 PVOID CallbackContext
;
502 BOOLEAN UnregisterWaiting
;
503 } CALLBACK_REGISTRATION
, *PCALLBACK_REGISTRATION
;
506 // Internal Callback Object
508 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
510 EX_RUNDOWN_REF RundownProtect
;
511 PEX_CALLBACK_FUNCTION Function
;
513 } EX_CALLBACK_ROUTINE_BLOCK
, *PEX_CALLBACK_ROUTINE_BLOCK
;
516 // Internal Callback Handle
518 typedef struct _EX_CALLBACK
520 EX_FAST_REF RoutineBlock
;
521 } EX_CALLBACK
, *PEX_CALLBACK
;
526 typedef struct _EPROFILE
534 PKPROFILE ProfileObject
;
535 PVOID LockedBufferAddress
;
538 KPROFILE_SOURCE ProfileSource
;
540 } EPROFILE
, *PEPROFILE
;
543 // Handle Table Structures
545 typedef struct _HANDLE_TRACE_DB_ENTRY
550 PVOID StackTrace
[16];
551 } HANDLE_TRACE_DB_ENTRY
, *PHANDLE_TRACE_DB_ENTRY
;
553 typedef struct _HANDLE_TRACE_DEBUG_INFO
558 FAST_MUTEX CloseCompatcionLock
;
559 ULONG CurrentStackIndex
;
560 HANDLE_TRACE_DB_ENTRY TraceDb
[1];
561 } HANDLE_TRACE_DEBUG_INFO
, *PHANDLE_TRACE_DEBUG_INFO
;
563 typedef struct _HANDLE_TABLE_ENTRY_INFO
566 } HANDLE_TABLE_ENTRY_INFO
, *PHANDLE_TABLE_ENTRY_INFO
;
568 typedef struct _HANDLE_TABLE_ENTRY
573 ULONG_PTR ObAttributes
;
574 PHANDLE_TABLE_ENTRY_INFO InfoTable
;
582 USHORT GrantedAccessIndex
;
583 USHORT CreatorBackTraceIndex
;
585 LONG NextFreeTableEntry
;
587 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
589 typedef struct _HANDLE_TABLE
591 #if (NTDDI_VERSION >= NTDDI_WINXP)
594 PHANDLE_TABLE_ENTRY
**Table
;
596 PEPROCESS QuotaProcess
;
597 PVOID UniqueProcessId
;
598 #if (NTDDI_VERSION >= NTDDI_WINXP)
599 EX_PUSH_LOCK HandleTableLock
[4];
600 LIST_ENTRY HandleTableList
;
601 EX_PUSH_LOCK HandleContentionEvent
;
603 ERESOURCE HandleLock
;
604 LIST_ENTRY HandleTableList
;
605 KEVENT HandleContentionEvent
;
607 PHANDLE_TRACE_DEBUG_INFO DebugInfo
;
609 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
615 LONG FirstFreeHandle
;
616 PHANDLE_TABLE_ENTRY LastFreeHandleEntry
;
618 ULONG NextHandleNeedingPool
;
622 ULONG NextHandleNeedingPool
;
630 } HANDLE_TABLE
, *PHANDLE_TABLE
;
635 // Hard Error LPC Message
637 typedef struct _HARDERROR_MSG
641 LARGE_INTEGER ErrorTime
;
642 ULONG ValidResponseOptions
;
644 ULONG NumberOfParameters
;
645 ULONG UnicodeStringParameterMask
;
646 ULONG_PTR Parameters
[MAXIMUM_HARDERROR_PARAMETERS
];
647 } HARDERROR_MSG
, *PHARDERROR_MSG
;
650 // Information Structures for NtQueryMutant
652 typedef struct _MUTANT_BASIC_INFORMATION
655 BOOLEAN OwnedByCaller
;
656 BOOLEAN AbandonedState
;
657 } MUTANT_BASIC_INFORMATION
, *PMUTANT_BASIC_INFORMATION
;
659 typedef struct _MUTANT_OWNER_INFORMATION
662 } MUTANT_OWNER_INFORMATION
, *PMUTANT_OWNER_INFORMATION
;
665 // Information Structures for NtQueryAtom
667 typedef struct _ATOM_BASIC_INFORMATION
673 } ATOM_BASIC_INFORMATION
, *PATOM_BASIC_INFORMATION
;
675 typedef struct _ATOM_TABLE_INFORMATION
679 } ATOM_TABLE_INFORMATION
, *PATOM_TABLE_INFORMATION
;
682 // Information Structures for NtQueryTimer
684 typedef struct _TIMER_BASIC_INFORMATION
686 LARGE_INTEGER TimeRemaining
;
688 } TIMER_BASIC_INFORMATION
, *PTIMER_BASIC_INFORMATION
;
691 // Information Structures for NtQuerySemaphore
693 typedef struct _SEMAPHORE_BASIC_INFORMATION
697 } SEMAPHORE_BASIC_INFORMATION
, *PSEMAPHORE_BASIC_INFORMATION
;
700 // Information Structures for NtQueryEvent
702 typedef struct _EVENT_BASIC_INFORMATION
704 EVENT_TYPE EventType
;
706 } EVENT_BASIC_INFORMATION
, *PEVENT_BASIC_INFORMATION
;
709 // Information Structures for NtQuerySystemInformation
711 typedef struct _SYSTEM_BASIC_INFORMATION
714 ULONG TimerResolution
;
716 ULONG NumberOfPhysicalPages
;
717 ULONG LowestPhysicalPageNumber
;
718 ULONG HighestPhysicalPageNumber
;
719 ULONG AllocationGranularity
;
720 ULONG_PTR MinimumUserModeAddress
;
721 ULONG_PTR MaximumUserModeAddress
;
722 ULONG_PTR ActiveProcessorsAffinityMask
;
723 CCHAR NumberOfProcessors
;
724 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
727 typedef struct _SYSTEM_PROCESSOR_INFORMATION
729 USHORT ProcessorArchitecture
;
730 USHORT ProcessorLevel
;
731 USHORT ProcessorRevision
;
733 ULONG ProcessorFeatureBits
;
734 } SYSTEM_PROCESSOR_INFORMATION
, *PSYSTEM_PROCESSOR_INFORMATION
;
737 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
739 LARGE_INTEGER IdleProcessTime
;
740 LARGE_INTEGER IoReadTransferCount
;
741 LARGE_INTEGER IoWriteTransferCount
;
742 LARGE_INTEGER IoOtherTransferCount
;
743 ULONG IoReadOperationCount
;
744 ULONG IoWriteOperationCount
;
745 ULONG IoOtherOperationCount
;
746 ULONG AvailablePages
;
747 ULONG CommittedPages
;
749 ULONG PeakCommitment
;
750 ULONG PageFaultCount
;
751 ULONG CopyOnWriteCount
;
752 ULONG TransitionCount
;
753 ULONG CacheTransitionCount
;
754 ULONG DemandZeroCount
;
756 ULONG PageReadIoCount
;
757 ULONG CacheReadCount
;
759 ULONG DirtyPagesWriteCount
;
760 ULONG DirtyWriteIoCount
;
761 ULONG MappedPagesWriteCount
;
762 ULONG MappedWriteIoCount
;
763 ULONG PagedPoolPages
;
764 ULONG NonPagedPoolPages
;
765 ULONG PagedPoolAllocs
;
766 ULONG PagedPoolFrees
;
767 ULONG NonPagedPoolAllocs
;
768 ULONG NonPagedPoolFrees
;
769 ULONG FreeSystemPtes
;
770 ULONG ResidentSystemCodePage
;
771 ULONG TotalSystemDriverPages
;
772 ULONG TotalSystemCodePages
;
773 ULONG NonPagedPoolLookasideHits
;
774 ULONG PagedPoolLookasideHits
;
776 ULONG ResidentSystemCachePage
;
777 ULONG ResidentPagedPoolPage
;
778 ULONG ResidentSystemDriverPage
;
779 ULONG CcFastReadNoWait
;
780 ULONG CcFastReadWait
;
781 ULONG CcFastReadResourceMiss
;
782 ULONG CcFastReadNotPossible
;
783 ULONG CcFastMdlReadNoWait
;
784 ULONG CcFastMdlReadWait
;
785 ULONG CcFastMdlReadResourceMiss
;
786 ULONG CcFastMdlReadNotPossible
;
787 ULONG CcMapDataNoWait
;
789 ULONG CcMapDataNoWaitMiss
;
790 ULONG CcMapDataWaitMiss
;
791 ULONG CcPinMappedDataCount
;
792 ULONG CcPinReadNoWait
;
794 ULONG CcPinReadNoWaitMiss
;
795 ULONG CcPinReadWaitMiss
;
796 ULONG CcCopyReadNoWait
;
797 ULONG CcCopyReadWait
;
798 ULONG CcCopyReadNoWaitMiss
;
799 ULONG CcCopyReadWaitMiss
;
800 ULONG CcMdlReadNoWait
;
802 ULONG CcMdlReadNoWaitMiss
;
803 ULONG CcMdlReadWaitMiss
;
804 ULONG CcReadAheadIos
;
805 ULONG CcLazyWriteIos
;
806 ULONG CcLazyWritePages
;
809 ULONG ContextSwitches
;
810 ULONG FirstLevelTbFills
;
811 ULONG SecondLevelTbFills
;
813 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
816 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
818 LARGE_INTEGER BootTime
;
819 LARGE_INTEGER CurrentTime
;
820 LARGE_INTEGER TimeZoneBias
;
823 #if (NTDDI_VERSION >= NTDDI_WIN2K)
824 ULONGLONG BootTimeBias
;
825 ULONGLONG SleepTimeBias
;
827 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
830 // This class is obsolete, please use KUSER_SHARED_DATA instead
833 typedef struct _SYSTEM_THREAD_INFORMATION
835 LARGE_INTEGER KernelTime
;
836 LARGE_INTEGER UserTime
;
837 LARGE_INTEGER CreateTime
;
843 ULONG ContextSwitches
;
846 ULONG PadPadAlignment
;
847 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
849 C_ASSERT(sizeof(SYSTEM_THREAD_INFORMATION
) == 0x40); // Must be 8-byte aligned
852 typedef struct _SYSTEM_PROCESS_INFORMATION
854 ULONG NextEntryOffset
;
855 ULONG NumberOfThreads
;
856 LARGE_INTEGER WorkingSetPrivateSize
; //VISTA
857 ULONG HardFaultCount
; //WIN7
858 ULONG NumberOfThreadsHighWatermark
; //WIN7
859 ULONGLONG CycleTime
; //WIN7
860 LARGE_INTEGER CreateTime
;
861 LARGE_INTEGER UserTime
;
862 LARGE_INTEGER KernelTime
;
863 UNICODE_STRING ImageName
;
864 KPRIORITY BasePriority
;
865 HANDLE UniqueProcessId
;
866 HANDLE InheritedFromUniqueProcessId
;
869 ULONG_PTR PageDirectoryBase
;
872 // This part corresponds to VM_COUNTERS_EX.
873 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
875 SIZE_T PeakVirtualSize
;
877 ULONG PageFaultCount
;
878 SIZE_T PeakWorkingSetSize
;
879 SIZE_T WorkingSetSize
;
880 SIZE_T QuotaPeakPagedPoolUsage
;
881 SIZE_T QuotaPagedPoolUsage
;
882 SIZE_T QuotaPeakNonPagedPoolUsage
;
883 SIZE_T QuotaNonPagedPoolUsage
;
884 SIZE_T PagefileUsage
;
885 SIZE_T PeakPagefileUsage
;
886 SIZE_T PrivatePageCount
;
889 // This part corresponds to IO_COUNTERS
891 LARGE_INTEGER ReadOperationCount
;
892 LARGE_INTEGER WriteOperationCount
;
893 LARGE_INTEGER OtherOperationCount
;
894 LARGE_INTEGER ReadTransferCount
;
895 LARGE_INTEGER WriteTransferCount
;
896 LARGE_INTEGER OtherTransferCount
;
897 // SYSTEM_THREAD_INFORMATION TH[1];
898 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
900 C_ASSERT(sizeof(SYSTEM_PROCESS_INFORMATION
) == 0xB8); // Must be 8-byte aligned
905 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
908 ULONG NumberOfTables
;
909 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
912 typedef struct _SYSTEM_DEVICE_INFORMATION
915 ULONG NumberOfFloppies
;
916 ULONG NumberOfCdRoms
;
918 ULONG NumberOfSerialPorts
;
919 ULONG NumberOfParallelPorts
;
920 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
923 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
925 LARGE_INTEGER IdleTime
;
926 LARGE_INTEGER KernelTime
;
927 LARGE_INTEGER UserTime
;
928 LARGE_INTEGER DpcTime
;
929 LARGE_INTEGER InterruptTime
;
930 ULONG InterruptCount
;
931 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
934 typedef struct _SYSTEM_FLAGS_INFORMATION
937 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
940 typedef struct _SYSTEM_CALL_TIME_INFORMATION
944 LARGE_INTEGER TimeOfCalls
[1];
945 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
947 // Class 11 - See RTL_PROCESS_MODULES
949 // Class 12 - See RTL_PROCESS_LOCKS
951 // Class 13 - See RTL_PROCESS_BACKTRACES
954 typedef struct _SYSTEM_POOL_ENTRY
958 USHORT AllocatorBackTraceIndex
;
964 PVOID ProcessChargedQuota
;
966 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
968 typedef struct _SYSTEM_POOL_INFORMATION
972 USHORT EntryOverhead
;
973 BOOLEAN PoolTagPresent
;
975 ULONG NumberOfEntries
;
976 SYSTEM_POOL_ENTRY Entries
[1];
977 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
980 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
982 USHORT UniqueProcessId
;
983 USHORT CreatorBackTraceIndex
;
984 UCHAR ObjectTypeIndex
;
985 UCHAR HandleAttributes
;
989 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
991 typedef struct _SYSTEM_HANDLE_INFORMATION
993 ULONG NumberOfHandles
;
994 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
995 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
998 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
1000 ULONG NextEntryOffset
;
1001 ULONG NumberOfObjects
;
1002 ULONG NumberOfHandles
;
1004 ULONG InvalidAttributes
;
1005 GENERIC_MAPPING GenericMapping
;
1006 ULONG ValidAccessMask
;
1008 BOOLEAN SecurityRequired
;
1009 BOOLEAN WaitableObject
;
1010 UNICODE_STRING TypeName
;
1011 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
1013 typedef struct _SYSTEM_OBJECT_INFORMATION
1015 ULONG NextEntryOffset
;
1017 HANDLE CreatorUniqueProcess
;
1018 USHORT CreatorBackTraceIndex
;
1022 ULONG PagedPoolCharge
;
1023 ULONG NonPagedPoolCharge
;
1024 HANDLE ExclusiveProcessId
;
1025 PVOID SecurityDescriptor
;
1026 OBJECT_NAME_INFORMATION NameInfo
;
1027 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
1030 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1032 ULONG NextEntryOffset
;
1036 UNICODE_STRING PageFileName
;
1037 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
1040 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1042 ULONG SegmentNotPresent
;
1044 ULONG OpcodeESPrefix
;
1045 ULONG OpcodeCSPrefix
;
1046 ULONG OpcodeSSPrefix
;
1047 ULONG OpcodeDSPrefix
;
1048 ULONG OpcodeFSPrefix
;
1049 ULONG OpcodeGSPrefix
;
1050 ULONG OpcodeOPER32Prefix
;
1051 ULONG OpcodeADDR32Prefix
;
1063 ULONG OpcodeOUTBimm
;
1064 ULONG OpcodeOUTWimm
;
1069 ULONG OpcodeLOCKPrefix
;
1070 ULONG OpcodeREPNEPrefix
;
1071 ULONG OpcodeREPPrefix
;
1076 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
1078 // Class 20 - ULONG VDMBOPINFO
1081 typedef struct _SYSTEM_FILECACHE_INFORMATION
1085 ULONG PageFaultCount
;
1086 SIZE_T MinimumWorkingSet
;
1087 SIZE_T MaximumWorkingSet
;
1088 SIZE_T CurrentSizeIncludingTransitionInPages
;
1089 SIZE_T PeakSizeIncludingTransitionInPages
;
1090 ULONG TransitionRePurposeCount
;
1092 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1095 typedef struct _SYSTEM_POOLTAG
1105 ULONG NonPagedAllocs
;
1106 ULONG NonPagedFrees
;
1107 SIZE_T NonPagedUsed
;
1108 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1110 typedef struct _SYSTEM_POOLTAG_INFORMATION
1113 SYSTEM_POOLTAG TagInfo
[1];
1114 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1117 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1119 ULONG ContextSwitches
;
1122 ULONG TimeIncrement
;
1123 ULONG DpcBypassCount
;
1124 ULONG ApcBypassCount
;
1125 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1128 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1131 ULONG DpcQueueDepth
;
1132 ULONG MinimumDpcRate
;
1133 ULONG AdjustDpcThreshold
;
1135 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1138 typedef struct _SYSTEM_MEMORY_INFO
1140 PUCHAR StringOffset
;
1142 USHORT TransitionCount
;
1143 USHORT ModifiedCount
;
1144 USHORT PageTableCount
;
1145 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1147 typedef struct _SYSTEM_MEMORY_INFORMATION
1151 SYSTEM_MEMORY_INFO Memory
[1];
1152 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1155 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1157 UNICODE_STRING DriverName
;
1159 PVOID SectionPointer
;
1161 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1163 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1166 // Not an actually class, simply a PVOID to the ImageAddress
1169 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1171 ULONG TimeAdjustment
;
1172 ULONG TimeIncrement
;
1174 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1176 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1178 ULONG TimeAdjustment
;
1180 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1182 // Class 29 - Same as 25
1187 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1190 UCHAR TracePermanent
;
1191 UNICODE_STRING TraceProcessName
;
1192 UNICODE_STRING TracePoolTags
;
1193 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1195 // Class 32 - OBSOLETE
1198 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1200 ULONG AlignmentFixupCount
;
1201 ULONG ExceptionDispatchCount
;
1202 ULONG FloatingEmulationCount
;
1203 ULONG ByteWordEmulationCount
;
1204 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1207 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1209 ULONG ValidCrashDump
;
1210 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1213 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1215 BOOLEAN KernelDebuggerEnabled
;
1216 BOOLEAN KernelDebuggerNotPresent
;
1217 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1220 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1222 ULONG ContextSwitches
;
1231 ULONG PreemptCurrent
;
1234 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1237 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1239 ULONG RegistryQuotaAllowed
;
1240 ULONG RegistryQuotaUsed
;
1241 SIZE_T PagedPoolSize
;
1242 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1245 // Not a structure, simply send the UNICODE_STRING
1248 // Not a structure, simply send a ULONG containing the new separation
1251 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1254 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1255 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1258 typedef struct _SYSTEM_DOCK_INFORMATION
1260 SYSTEM_DOCK_STATE DockState
;
1261 INTERFACE_TYPE DeviceBusType
;
1262 ULONG DeviceBusNumber
;
1264 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1267 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1269 BOOLEAN SystemSuspendSupported
;
1270 BOOLEAN SystemHibernateSupported
;
1271 BOOLEAN ResumeTimerSupportsSuspend
;
1272 BOOLEAN ResumeTimerSupportsHibernate
;
1273 BOOLEAN LidSupported
;
1274 BOOLEAN TurboSettingSupported
;
1276 BOOLEAN SystemAcOrDc
;
1277 BOOLEAN PowerDownDisabled
;
1278 LARGE_INTEGER SpindownDrives
;
1279 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1282 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1284 PNP_VETO_TYPE VetoType
;
1285 UNICODE_STRING VetoDriver
;
1286 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1289 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1292 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1294 USHORT CurrentDepth
;
1295 USHORT MaximumDepth
;
1296 ULONG TotalAllocates
;
1297 ULONG AllocateMisses
;
1303 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1306 // Not a structure. Only a HANDLE for the SlipEvent;
1309 // Not a structure. Only a ULONG for the SessionId;
1312 // Not a structure. Only a ULONG for the SessionId;
1317 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1320 typedef struct _SYSTEM_VERIFIER_INFORMATION
1322 ULONG NextEntryOffset
;
1324 UNICODE_STRING DriverName
;
1326 ULONG AcquireSpinLocks
;
1327 ULONG SynchronizeExecutions
;
1328 ULONG AllocationsAttempted
;
1329 ULONG AllocationsSucceeded
;
1330 ULONG AllocationsSucceededSpecialPool
;
1331 ULONG AllocationsWithNoTag
;
1334 ULONG AllocationsFailed
;
1335 ULONG AllocationsFailedDeliberately
;
1338 ULONG UnTrackedPool
;
1339 ULONG CurrentPagedPoolAllocations
;
1340 ULONG CurrentNonPagedPoolAllocations
;
1341 ULONG PeakPagedPoolAllocations
;
1342 ULONG PeakNonPagedPoolAllocations
;
1343 SIZE_T PagedPoolUsageInBytes
;
1344 SIZE_T NonPagedPoolUsageInBytes
;
1345 SIZE_T PeakPagedPoolUsageInBytes
;
1346 SIZE_T PeakNonPagedPoolUsageInBytes
;
1347 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1352 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1356 PVOID Buffer
; // Same format as in SystemProcessInformation
1357 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1359 // FIXME: Class 54-97
1364 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1365 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1366 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1367 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1368 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1369 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1373 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1392 USHORT TargetNameOffset
;
1393 USHORT TargetNameLength
;
1394 UCHAR PatchingFinished
;
1400 USHORT TargetNameOffset
;
1401 USHORT TargetNameLength
;
1402 UCHAR PatchingFinished
;
1403 NTSTATUS ReturnCode
;
1404 HANDLE TargetProcess
;
1409 PIO_STATUS_BLOCK IoStatusBlock1
;
1410 PVOID RenameInformation1
;
1411 PVOID RenameInformationLength1
;
1413 PIO_STATUS_BLOCK IoStatusBlock2
;
1414 PVOID RenameInformation2
;
1415 PVOID RenameInformationLength2
;
1419 HANDLE ParentDirectory
;
1420 HANDLE ObjectHandle1
;
1421 HANDLE ObjectHandle2
;
1424 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1429 #ifdef NTOS_MODE_USER
1430 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1432 ULONG ProviderSignature
;
1434 PFNFTH FirmwareTableHandler
;
1436 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1441 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1443 ULONG ProviderSignature
;
1444 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1446 ULONG TableBufferLength
;
1447 UCHAR TableBuffer
[1];
1448 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;
1453 typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
1455 SIZE_T ZeroPageCount
;
1456 SIZE_T FreePageCount
;
1457 SIZE_T ModifiedPageCount
;
1458 SIZE_T ModifiedNoWritePageCount
;
1459 SIZE_T BadPageCount
;
1460 SIZE_T PageCountByPriority
[8];
1461 SIZE_T RepurposedPagesByPriority
[8];
1462 SIZE_T ModifiedPageCountPageFile
;
1463 } SYSTEM_MEMORY_LIST_INFORMATION
, *PSYSTEM_MEMORY_LIST_INFORMATION
;