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)
39 #define __ALIGNED(n) __attribute__((aligned (n)))
40 #elif defined(_MSC_VER)
41 #define __ALIGNED(n) __declspec(align(n))
43 #error __ALIGNED not defined for your compiler!
47 // Atom and Language IDs
49 typedef USHORT LANGID
, *PLANGID
;
50 typedef USHORT RTL_ATOM
, *PRTL_ATOM
;
52 #ifndef NTOS_MODE_USER
55 // Kernel Exported Object Types
57 extern POBJECT_TYPE NTSYSAPI ExDesktopObjectType
;
58 extern POBJECT_TYPE NTSYSAPI ExWindowStationObjectType
;
59 extern POBJECT_TYPE NTSYSAPI ExIoCompletionType
;
60 extern POBJECT_TYPE NTSYSAPI ExMutantObjectType
;
61 extern POBJECT_TYPE NTSYSAPI ExTimerType
;
64 // Exported NT Build Number
66 extern ULONG NtBuildNumber
;
69 // Invalid Handle Value Constant
71 #define INVALID_HANDLE_VALUE (HANDLE)-1
78 #define MUTANT_INCREMENT 1
81 // Callback Object Access Mask
83 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
84 #define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
85 #define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
86 #define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
89 // Event Object Access Masks
92 #define EVENT_QUERY_STATE 0x0001
95 // Semaphore Object Access Masks
97 #define SEMAPHORE_QUERY_STATE 0x0001
101 // Mutant Object Access Masks
103 #define MUTANT_QUERY_STATE 0x0001
104 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
108 #define TIMER_QUERY_STATE 0x0001
109 #define TIMER_MODIFY_STATE 0x0002
110 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
112 TIMER_QUERY_STATE | \
117 // Event Pair Access Masks
119 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
122 // Profile Object Access Masks
124 #define PROFILE_CONTROL 0x0001
125 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
128 // Maximum Parameters for NtRaiseHardError
130 #define MAXIMUM_HARDERROR_PARAMETERS 4
135 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
136 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
137 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
138 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
139 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
140 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
141 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
144 // Pushlock Wait Block Flags
146 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
147 #define EX_PUSH_LOCK_FLAGS_WAIT 2
150 // Resource (ERESOURCE) Flags
152 #define ResourceHasDisabledPriorityBoost 0x08
155 // Shutdown types for NtShutdownSystem
157 typedef enum _SHUTDOWN_ACTION
165 // Responses for NtRaiseHardError
167 typedef enum _HARDERROR_RESPONSE_OPTION
169 OptionAbortRetryIgnore
,
176 } HARDERROR_RESPONSE_OPTION
, *PHARDERROR_RESPONSE_OPTION
;
178 typedef enum _HARDERROR_RESPONSE
180 ResponseReturnToCaller
,
191 } HARDERROR_RESPONSE
, *PHARDERROR_RESPONSE
;
194 // System Information Classes for NtQuerySystemInformation
196 typedef enum _SYSTEM_INFORMATION_CLASS
198 SystemBasicInformation
,
199 SystemProcessorInformation
,
200 SystemPerformanceInformation
,
201 SystemTimeOfDayInformation
,
202 SystemPathInformation
, /// Obsolete: Use KUSER_SHARED_DATA
203 SystemProcessInformation
,
204 SystemCallCountInformation
,
205 SystemDeviceInformation
,
206 SystemProcessorPerformanceInformation
,
207 SystemFlagsInformation
,
208 SystemCallTimeInformation
,
209 SystemModuleInformation
,
210 SystemLocksInformation
,
211 SystemStackTraceInformation
,
212 SystemPagedPoolInformation
,
213 SystemNonPagedPoolInformation
,
214 SystemHandleInformation
,
215 SystemObjectInformation
,
216 SystemPageFileInformation
,
217 SystemVdmInstemulInformation
,
218 SystemVdmBopInformation
,
219 SystemFileCacheInformation
,
220 SystemPoolTagInformation
,
221 SystemInterruptInformation
,
222 SystemDpcBehaviorInformation
,
223 SystemFullMemoryInformation
,
224 SystemLoadGdiDriverInformation
,
225 SystemUnloadGdiDriverInformation
,
226 SystemTimeAdjustmentInformation
,
227 SystemSummaryMemoryInformation
,
228 SystemMirrorMemoryInformation
,
229 SystemPerformanceTraceInformation
,
231 SystemExceptionInformation
,
232 SystemCrashDumpStateInformation
,
233 SystemKernelDebuggerInformation
,
234 SystemContextSwitchInformation
,
235 SystemRegistryQuotaInformation
,
236 SystemExtendServiceTableInformation
,
237 SystemPrioritySeperation
,
238 SystemPlugPlayBusInformation
,
239 SystemDockInformation
,
240 SystemPowerInformationNative
,
241 SystemProcessorSpeedInformation
,
242 SystemCurrentTimeZoneInformation
,
243 SystemLookasideInformation
,
244 SystemTimeSlipNotification
,
247 SystemSessionInformation
,
248 SystemRangeStartInformation
,
249 SystemVerifierInformation
,
251 SystemSessionProcessesInformation
,
252 SystemLoadGdiDriverInSystemSpaceInformation
,
253 SystemNumaProcessorMap
,
254 SystemPrefetcherInformation
,
255 SystemExtendedProcessInformation
,
256 SystemRecommendedSharedDataAlignment
,
257 SystemComPlusPackage
,
258 SystemNumaAvailableMemory
,
259 SystemProcessorPowerInformation
,
260 SystemEmulationBasicInformation
,
261 SystemEmulationProcessorInformation
,
262 SystemExtendedHanfleInformation
,
263 SystemLostDelayedWriteInformation
,
264 SystemBigPoolInformation
,
265 SystemSessionPoolTagInformation
,
266 SystemSessionMappedViewInformation
,
267 SystemHotpatchInformation
,
268 SystemObjectSecurityMode
,
269 SystemWatchDogTimerHandler
,
270 SystemWatchDogTimerInformation
,
271 SystemLogicalProcessorInformation
,
272 SystemWo64SharedInformationObosolete
,
273 SystemRegisterFirmwareTableInformationHandler
,
274 SystemFirmwareTableInformation
,
275 SystemModuleInformationEx
,
276 SystemVerifierTriageInformation
,
277 SystemSuperfetchInformation
,
278 SystemMemoryListInformation
,
279 SystemFileCacheInformationEx
,
280 SystemThreadPriorityClientIdInformation
,
281 SystemProcessorIdleCycleTimeInformation
,
282 SystemVerifierCancellationInformation
,
283 SystemProcessorPowerInformationEx
,
284 SystemRefTraceInformation
,
285 SystemSpecialPoolInformation
,
286 SystemProcessIdInformation
,
287 SystemErrorPortInformation
,
288 SystemBootEnvironmentInformation
,
289 SystemHypervisorInformation
,
290 SystemVerifierInformationEx
,
291 SystemTimeZoneInformation
,
292 SystemImageFileExecutionOptionsInformation
,
293 SystemCoverageInformation
,
294 SystemPrefetchPathInformation
,
295 SystemVerifierFaultsInformation
,
297 } SYSTEM_INFORMATION_CLASS
;
300 // System Information Classes for NtQueryMutant
302 typedef enum _MUTANT_INFORMATION_CLASS
304 MutantBasicInformation
,
305 MutantOwnerInformation
306 } MUTANT_INFORMATION_CLASS
;
309 // System Information Classes for NtQueryAtom
311 typedef enum _ATOM_INFORMATION_CLASS
313 AtomBasicInformation
,
314 AtomTableInformation
,
315 } ATOM_INFORMATION_CLASS
;
318 // System Information Classes for NtQueryTimer
320 typedef enum _TIMER_INFORMATION_CLASS
322 TimerBasicInformation
323 } TIMER_INFORMATION_CLASS
;
326 // System Information Classes for NtQuerySemaphore
328 typedef enum _SEMAPHORE_INFORMATION_CLASS
330 SemaphoreBasicInformation
331 } SEMAPHORE_INFORMATION_CLASS
;
334 // System Information Classes for NtQueryEvent
336 typedef enum _EVENT_INFORMATION_CLASS
338 EventBasicInformation
339 } EVENT_INFORMATION_CLASS
;
341 #ifdef NTOS_MODE_USER
344 // Firmware Table Actions for SystemFirmwareTableInformation
346 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
348 SystemFirmwareTable_Enumerate
= 0,
349 SystemFirmwareTable_Get
= 1,
350 } SYSTEM_FIRMWARE_TABLE_ACTION
, *PSYSTEM_FIRMWARE_TABLE_ACTION
;
353 // Firmware Handler Callback
355 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
;
359 IN
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
*FirmwareTableInformation
365 // Compatibility with Windows XP Drivers using ERESOURCE
367 typedef struct _ERESOURCE_XP
369 LIST_ENTRY SystemResourcesList
;
370 POWNER_ENTRY OwnerTable
;
373 PKSEMAPHORE SharedWaiters
;
374 PKEVENT ExclusiveWaiters
;
375 OWNER_ENTRY OwnerThreads
[2];
376 ULONG ContentionCount
;
377 USHORT NumberOfSharedWaiters
;
378 USHORT NumberOfExclusiveWaiters
;
382 ULONG_PTR CreatorBackTraceIndex
;
385 } ERESOURCE_XP
, *PERESOURCE_XP
;
388 // Executive Work Queue Structures
390 typedef struct _EX_QUEUE_WORKER_INFO
392 ULONG QueueDisabled
:1;
393 ULONG MakeThreadsAsNecessary
:1;
395 ULONG WorkerCount
:29;
396 } EX_QUEUE_WORKER_INFO
, *PEX_QUEUE_WORKER_INFO
;
398 typedef struct _EX_WORK_QUEUE
401 LONG DynamicThreadCount
;
402 ULONG WorkItemsProcessed
;
403 ULONG WorkItemsProcessedLastPass
;
404 ULONG QueueDepthLastPass
;
405 EX_QUEUE_WORKER_INFO Info
;
406 } EX_WORK_QUEUE
, *PEX_WORK_QUEUE
;
409 // Executive Fast Reference Structure
411 typedef struct _EX_FAST_REF
419 } EX_FAST_REF
, *PEX_FAST_REF
;
422 // Executive Cache-Aware Rundown Reference Descriptor
424 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
426 PEX_RUNDOWN_REF RunRefs
;
430 } EX_RUNDOWN_REF_CACHE_AWARE
, *PEX_RUNDOWN_REF_CACHE_AWARE
;
433 // Executive Rundown Wait Block
435 typedef struct _EX_RUNDOWN_WAIT_BLOCK
439 } EX_RUNDOWN_WAIT_BLOCK
, *PEX_RUNDOWN_WAIT_BLOCK
;
442 // Executive Pushlock
446 typedef struct _EX_PUSH_LOCK
455 ULONG_PTR MultipleShared
:1;
456 ULONG_PTR Shared
:sizeof (ULONG_PTR
) * 8 - 4;
461 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
464 // Executive Pushlock Wait Block
466 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
473 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Next
;
474 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Last
;
475 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Previous
;
480 EX_PUSH_LOCK NewValue
;
481 EX_PUSH_LOCK OldValue
;
482 PEX_PUSH_LOCK PushLock
;
484 } EX_PUSH_LOCK_WAIT_BLOCK
, *PEX_PUSH_LOCK_WAIT_BLOCK
;
489 typedef struct _CALLBACK_OBJECT
493 LIST_ENTRY RegisteredCallbacks
;
494 ULONG AllowMultipleCallbacks
;
495 } CALLBACK_OBJECT
, *PCALLBACK_OBJECT
;
498 // Internal Callback Object
500 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
502 EX_RUNDOWN_REF RundownProtect
;
505 } EX_CALLBACK_ROUTINE_BLOCK
, *PEX_CALLBACK_ROUTINE_BLOCK
;
508 // Internal Callback Handle
510 typedef struct _EX_CALLBACK
512 EX_FAST_REF RoutineBlock
;
513 } EX_CALLBACK
, *PEX_CALLBACK
;
518 typedef struct _EPROFILE
526 PKPROFILE ProfileObject
;
527 PVOID LockedBufferAddress
;
530 KPROFILE_SOURCE ProfileSource
;
532 } EPROFILE
, *PEPROFILE
;
535 // Handle Table Structures
537 typedef struct _HANDLE_TRACE_DB_ENTRY
542 PVOID StackTrace
[16];
543 } HANDLE_TRACE_DB_ENTRY
, *PHANDLE_TRACE_DB_ENTRY
;
545 typedef struct _HANDLE_TRACE_DEBUG_INFO
550 FAST_MUTEX CloseCompatcionLock
;
551 ULONG CurrentStackIndex
;
552 HANDLE_TRACE_DB_ENTRY TraceDb
[1];
553 } HANDLE_TRACE_DEBUG_INFO
, *PHANDLE_TRACE_DEBUG_INFO
;
555 typedef struct _HANDLE_TABLE_ENTRY_INFO
558 } HANDLE_TABLE_ENTRY_INFO
, *PHANDLE_TABLE_ENTRY_INFO
;
560 typedef struct _HANDLE_TABLE_ENTRY
565 ULONG_PTR ObAttributes
;
566 PHANDLE_TABLE_ENTRY_INFO InfoTable
;
574 USHORT GrantedAccessIndex
;
575 USHORT CreatorBackTraceIndex
;
577 LONG NextFreeTableEntry
;
579 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
586 #define NTDDI_VERSION NTDDI_WIN2K
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 HandleLock
;
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 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 MinimumUserModeAddress
;
721 ULONG MaximumUserModeAddress
;
722 KAFFINITY 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 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
826 // This class is obsolete, please use KUSER_SHARED_DATA instead
829 typedef struct _SYSTEM_THREAD_INFORMATION
831 LARGE_INTEGER KernelTime
;
832 LARGE_INTEGER UserTime
;
833 LARGE_INTEGER CreateTime
;
839 ULONG ContextSwitches
;
842 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
844 typedef struct _SYSTEM_PROCESS_INFORMATION
846 ULONG NextEntryOffset
;
847 ULONG NumberOfThreads
;
848 LARGE_INTEGER SpareLi1
;
849 LARGE_INTEGER SpareLi2
;
850 LARGE_INTEGER SpareLi3
;
851 LARGE_INTEGER CreateTime
;
852 LARGE_INTEGER UserTime
;
853 LARGE_INTEGER KernelTime
;
854 UNICODE_STRING ImageName
;
855 KPRIORITY BasePriority
;
856 HANDLE UniqueProcessId
;
857 HANDLE InheritedFromUniqueProcessId
;
860 ULONG UniqueProcessKey
;
863 // This part corresponds to VM_COUNTERS_EX.
864 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
866 ULONG PeakVirtualSize
;
868 ULONG PageFaultCount
;
869 ULONG PeakWorkingSetSize
;
870 ULONG WorkingSetSize
;
871 ULONG QuotaPeakPagedPoolUsage
;
872 ULONG QuotaPagedPoolUsage
;
873 ULONG QuotaPeakNonPagedPoolUsage
;
874 ULONG QuotaNonPagedPoolUsage
;
876 ULONG PeakPagefileUsage
;
877 ULONG PrivatePageCount
;
880 // This part corresponds to IO_COUNTERS
882 LARGE_INTEGER ReadOperationCount
;
883 LARGE_INTEGER WriteOperationCount
;
884 LARGE_INTEGER OtherOperationCount
;
885 LARGE_INTEGER ReadTransferCount
;
886 LARGE_INTEGER WriteTransferCount
;
887 LARGE_INTEGER OtherTransferCount
;
889 //SYSTEM_THREAD_INFORMATION TH[1];
890 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
893 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
896 ULONG NumberOfTables
;
897 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
900 typedef struct _SYSTEM_DEVICE_INFORMATION
903 ULONG NumberOfFloppies
;
904 ULONG NumberOfCdRoms
;
906 ULONG NumberOfSerialPorts
;
907 ULONG NumberOfParallelPorts
;
908 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
911 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
913 LARGE_INTEGER IdleTime
;
914 LARGE_INTEGER KernelTime
;
915 LARGE_INTEGER UserTime
;
916 LARGE_INTEGER DpcTime
;
917 LARGE_INTEGER InterruptTime
;
918 ULONG InterruptCount
;
919 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
922 typedef struct _SYSTEM_FLAGS_INFORMATION
925 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
928 typedef struct _SYSTEM_CALL_TIME_INFORMATION
932 LARGE_INTEGER TimeOfCalls
[1];
933 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
935 // Class 11 - See RTL_PROCESS_MODULES
937 // Class 12 - See RTL_PROCESS_LOCKS
939 // Class 13 - See RTL_PROCESS_BACKTRACES
942 typedef struct _SYSTEM_POOL_ENTRY
946 USHORT AllocatorBackTraceIndex
;
952 PVOID ProcessChargedQuota
;
954 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
956 typedef struct _SYSTEM_POOL_INFORMATION
960 USHORT EntryOverhead
;
961 BOOLEAN PoolTagPresent
;
963 ULONG NumberOfEntries
;
964 SYSTEM_POOL_ENTRY Entries
[1];
965 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
968 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
970 USHORT UniqueProcessId
;
971 USHORT CreatorBackTraceIndex
;
972 UCHAR ObjectTypeIndex
;
973 UCHAR HandleAttributes
;
977 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
979 typedef struct _SYSTEM_HANDLE_INFORMATION
981 ULONG NumberOfHandles
;
982 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
983 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
986 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
988 ULONG NextEntryOffset
;
989 ULONG NumberOfObjects
;
990 ULONG NumberOfHandles
;
992 ULONG InvalidAttributes
;
993 GENERIC_MAPPING GenericMapping
;
994 ULONG ValidAccessMask
;
996 BOOLEAN SecurityRequired
;
997 BOOLEAN WaitableObject
;
998 UNICODE_STRING TypeName
;
999 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
1001 typedef struct _SYSTEM_OBJECT_INFORMATION
1003 ULONG NextEntryOffset
;
1005 HANDLE CreatorUniqueProcess
;
1006 USHORT CreatorBackTraceIndex
;
1010 ULONG PagedPoolCharge
;
1011 ULONG NonPagedPoolCharge
;
1012 HANDLE ExclusiveProcessId
;
1013 PVOID SecurityDescriptor
;
1014 OBJECT_NAME_INFORMATION NameInfo
;
1015 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
1018 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1020 ULONG NextEntryOffset
;
1024 UNICODE_STRING PageFileName
;
1025 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
1028 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1030 ULONG SegmentNotPresent
;
1032 ULONG OpcodeESPrefix
;
1033 ULONG OpcodeCSPrefix
;
1034 ULONG OpcodeSSPrefix
;
1035 ULONG OpcodeDSPrefix
;
1036 ULONG OpcodeFSPrefix
;
1037 ULONG OpcodeGSPrefix
;
1038 ULONG OpcodeOPER32Prefix
;
1039 ULONG OpcodeADDR32Prefix
;
1051 ULONG OpcodeOUTBimm
;
1052 ULONG OpcodeOUTWimm
;
1057 ULONG OpcodeLOCKPrefix
;
1058 ULONG OpcodeREPNEPrefix
;
1059 ULONG OpcodeREPPrefix
;
1064 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
1066 // Class 20 - ULONG VDMBOPINFO
1069 typedef struct _SYSTEM_FILECACHE_INFORMATION
1073 ULONG PageFaultCount
;
1074 ULONG MinimumWorkingSet
;
1075 ULONG MaximumWorkingSet
;
1076 ULONG CurrentSizeIncludingTransitionInPages
;
1077 ULONG PeakSizeIncludingTransitionInPages
;
1078 ULONG TransitionRePurposeCount
;
1080 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1083 typedef struct _SYSTEM_POOLTAG
1093 ULONG NonPagedAllocs
;
1094 ULONG NonPagedFrees
;
1096 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1097 typedef struct _SYSTEM_POOLTAG_INFORMATION
1100 SYSTEM_POOLTAG TagInfo
[1];
1101 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1104 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1106 ULONG ContextSwitches
;
1109 ULONG TimeIncrement
;
1110 ULONG DpcBypassCount
;
1111 ULONG ApcBypassCount
;
1112 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1115 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1118 ULONG DpcQueueDepth
;
1119 ULONG MinimumDpcRate
;
1120 ULONG AdjustDpcThreshold
;
1122 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1125 typedef struct _SYSTEM_MEMORY_INFO
1127 PUCHAR StringOffset
;
1129 USHORT TransitionCount
;
1130 USHORT ModifiedCount
;
1131 USHORT PageTableCount
;
1132 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1134 typedef struct _SYSTEM_MEMORY_INFORMATION
1138 SYSTEM_MEMORY_INFO Memory
[1];
1139 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1142 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1144 UNICODE_STRING DriverName
;
1146 PVOID SectionPointer
;
1148 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1150 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1153 // Not an actually class, simply a PVOID to the ImageAddress
1156 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1158 ULONG TimeAdjustment
;
1159 ULONG TimeIncrement
;
1161 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1163 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1165 ULONG TimeAdjustment
;
1167 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1169 // Class 29 - Same as 25
1174 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1177 UCHAR TracePermanent
;
1178 UNICODE_STRING TraceProcessName
;
1179 UNICODE_STRING TracePoolTags
;
1180 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1182 // Class 32 - OBSOLETE
1185 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1187 ULONG AlignmentFixupCount
;
1188 ULONG ExceptionDispatchCount
;
1189 ULONG FloatingEmulationCount
;
1190 ULONG ByteWordEmulationCount
;
1191 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1194 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1196 ULONG ValidCrashDump
;
1197 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1200 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1202 BOOLEAN KernelDebuggerEnabled
;
1203 BOOLEAN KernelDebuggerNotPresent
;
1204 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1207 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1209 ULONG ContextSwitches
;
1218 ULONG PreemptCurrent
;
1221 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1224 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1226 ULONG RegistryQuotaAllowed
;
1227 ULONG RegistryQuotaUsed
;
1228 ULONG PagedPoolSize
;
1229 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1232 // Not a structure, simply send the UNICODE_STRING
1235 // Not a structure, simply send a ULONG containing the new separation
1238 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1241 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1242 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1245 typedef struct _SYSTEM_DOCK_INFORMATION
1247 SYSTEM_DOCK_STATE DockState
;
1248 INTERFACE_TYPE DeviceBusType
;
1249 ULONG DeviceBusNumber
;
1251 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1254 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1256 BOOLEAN SystemSuspendSupported
;
1257 BOOLEAN SystemHibernateSupported
;
1258 BOOLEAN ResumeTimerSupportsSuspend
;
1259 BOOLEAN ResumeTimerSupportsHibernate
;
1260 BOOLEAN LidSupported
;
1261 BOOLEAN TurboSettingSupported
;
1263 BOOLEAN SystemAcOrDc
;
1264 BOOLEAN PowerDownDisabled
;
1265 LARGE_INTEGER SpindownDrives
;
1266 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1269 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1271 PNP_VETO_TYPE VetoType
;
1272 UNICODE_STRING VetoDriver
;
1274 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1277 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1280 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1282 USHORT CurrentDepth
;
1283 USHORT MaximumDepth
;
1284 ULONG TotalAllocates
;
1285 ULONG AllocateMisses
;
1291 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1294 // Not a structure. Only a HANDLE for the SlipEvent;
1297 // Not a structure. Only a ULONG for the SessionId;
1300 // Not a structure. Only a ULONG for the SessionId;
1305 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1308 typedef struct _SYSTEM_VERIFIER_INFORMATION
1310 ULONG NextEntryOffset
;
1312 UNICODE_STRING DriverName
;
1314 ULONG AcquireSpinLocks
;
1315 ULONG SynchronizeExecutions
;
1316 ULONG AllocationsAttempted
;
1317 ULONG AllocationsSucceeded
;
1318 ULONG AllocationsSucceededSpecialPool
;
1319 ULONG AllocationsWithNoTag
;
1322 ULONG AllocationsFailed
;
1323 ULONG AllocationsFailedDeliberately
;
1326 ULONG UnTrackedPool
;
1327 ULONG CurrentPagedPoolAllocations
;
1328 ULONG CurrentNonPagedPoolAllocations
;
1329 ULONG PeakPagedPoolAllocations
;
1330 ULONG PeakNonPagedPoolAllocations
;
1331 ULONG PagedPoolUsageInBytes
;
1332 ULONG NonPagedPoolUsageInBytes
;
1333 ULONG PeakPagedPoolUsageInBytes
;
1334 ULONG PeakNonPagedPoolUsageInBytes
;
1335 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1340 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1344 PVOID Buffer
; // Same format as in SystemProcessInformation
1345 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1347 // FIXME: Class 54-97
1352 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1353 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1354 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1355 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1356 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1357 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1361 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1380 USHORT TargetNameOffset
;
1381 USHORT TargetNameLength
;
1382 UCHAR PatchingFinished
;
1388 USHORT TargetNameOffset
;
1389 USHORT TargetNameLength
;
1390 UCHAR PatchingFinished
;
1391 NTSTATUS ReturnCode
;
1392 HANDLE TargetProcess
;
1397 PIO_STATUS_BLOCK IoStatusBlock1
;
1398 PVOID RenameInformation1
;
1399 PVOID RenameInformationLength1
;
1401 PIO_STATUS_BLOCK IoStatusBlock2
;
1402 PVOID RenameInformation2
;
1403 PVOID RenameInformationLength2
;
1407 HANDLE ParentDirectory
;
1408 HANDLE ObjectHandle1
;
1409 HANDLE ObjectHandle2
;
1412 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1417 #ifdef NTOS_MODE_USER
1418 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1420 ULONG ProviderSignature
;
1422 PFNFTH FirmwareTableHandler
;
1424 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1429 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1431 ULONG ProviderSignature
;
1432 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1434 ULONG TableBufferLength
;
1435 UCHAR TableBuffer
[1];
1436 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;