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)
46 #define __ALIGNED(n) __attribute__((aligned (n)))
47 #elif defined(_MSC_VER)
48 #define __ALIGNED(n) __declspec(align(n))
50 #error __ALIGNED not defined for your compiler!
56 typedef USHORT RTL_ATOM
, *PRTL_ATOM
;
58 #ifndef NTOS_MODE_USER
61 // Kernel Exported Object Types
63 extern POBJECT_TYPE NTSYSAPI ExDesktopObjectType
;
64 extern POBJECT_TYPE NTSYSAPI ExWindowStationObjectType
;
65 extern POBJECT_TYPE NTSYSAPI ExIoCompletionType
;
66 extern POBJECT_TYPE NTSYSAPI ExMutantObjectType
;
67 extern POBJECT_TYPE NTSYSAPI ExTimerType
;
70 // Exported NT Build Number
72 extern ULONG NTSYSAPI NtBuildNumber
;
75 // Invalid Handle Value Constant
77 #define INVALID_HANDLE_VALUE (HANDLE)-1
84 #define MUTANT_INCREMENT 1
87 // Callback Object Access Mask
89 #define CALLBACK_MODIFY_STATE 0x0001
90 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
92 CALLBACK_MODIFY_STATE)
95 // Event Object Access Masks
98 #define EVENT_QUERY_STATE 0x0001
101 // Semaphore Object Access Masks
103 #define SEMAPHORE_QUERY_STATE 0x0001
107 // Mutant Object Access Masks
109 #define MUTANT_QUERY_STATE 0x0001
110 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
114 #define TIMER_QUERY_STATE 0x0001
115 #define TIMER_MODIFY_STATE 0x0002
116 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
118 TIMER_QUERY_STATE | \
123 // Event Pair Access Masks
125 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
128 // Profile Object Access Masks
130 #define PROFILE_CONTROL 0x0001
131 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
134 // NtRaiseHardError-related parameters
136 #define MAXIMUM_HARDERROR_PARAMETERS 4
137 #define HARDERROR_OVERRIDE_ERRORMODE 0x10000000
142 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
143 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
144 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
145 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
146 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
147 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
148 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
151 // Pushlock Wait Block Flags
153 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
154 #define EX_PUSH_LOCK_FLAGS_WAIT_V 1
155 #define EX_PUSH_LOCK_FLAGS_WAIT 2
158 // Resource (ERESOURCE) Flags
160 #define ResourceHasDisabledPriorityBoost 0x08
163 // Shutdown types for NtShutdownSystem
165 typedef enum _SHUTDOWN_ACTION
173 // Responses for NtRaiseHardError
175 typedef enum _HARDERROR_RESPONSE_OPTION
177 OptionAbortRetryIgnore
,
183 OptionShutdownSystem
,
185 OptionCancelTryContinue
186 } HARDERROR_RESPONSE_OPTION
, *PHARDERROR_RESPONSE_OPTION
;
188 typedef enum _HARDERROR_RESPONSE
190 ResponseReturnToCaller
,
201 } HARDERROR_RESPONSE
, *PHARDERROR_RESPONSE
;
204 // System Information Classes for NtQuerySystemInformation
206 typedef enum _SYSTEM_INFORMATION_CLASS
208 SystemBasicInformation
,
209 SystemProcessorInformation
,
210 SystemPerformanceInformation
,
211 SystemTimeOfDayInformation
,
212 SystemPathInformation
, /// Obsolete: Use KUSER_SHARED_DATA
213 SystemProcessInformation
,
214 SystemCallCountInformation
,
215 SystemDeviceInformation
,
216 SystemProcessorPerformanceInformation
,
217 SystemFlagsInformation
,
218 SystemCallTimeInformation
,
219 SystemModuleInformation
,
220 SystemLocksInformation
,
221 SystemStackTraceInformation
,
222 SystemPagedPoolInformation
,
223 SystemNonPagedPoolInformation
,
224 SystemHandleInformation
,
225 SystemObjectInformation
,
226 SystemPageFileInformation
,
227 SystemVdmInstemulInformation
,
228 SystemVdmBopInformation
,
229 SystemFileCacheInformation
,
230 SystemPoolTagInformation
,
231 SystemInterruptInformation
,
232 SystemDpcBehaviorInformation
,
233 SystemFullMemoryInformation
,
234 SystemLoadGdiDriverInformation
,
235 SystemUnloadGdiDriverInformation
,
236 SystemTimeAdjustmentInformation
,
237 SystemSummaryMemoryInformation
,
238 SystemMirrorMemoryInformation
,
239 SystemPerformanceTraceInformation
,
241 SystemExceptionInformation
,
242 SystemCrashDumpStateInformation
,
243 SystemKernelDebuggerInformation
,
244 SystemContextSwitchInformation
,
245 SystemRegistryQuotaInformation
,
246 SystemExtendServiceTableInformation
,
247 SystemPrioritySeperation
,
248 SystemPlugPlayBusInformation
,
249 SystemDockInformation
,
250 SystemPowerInformationNative
,
251 SystemProcessorSpeedInformation
,
252 SystemCurrentTimeZoneInformation
,
253 SystemLookasideInformation
,
254 SystemTimeSlipNotification
,
257 SystemSessionInformation
,
258 SystemRangeStartInformation
,
259 SystemVerifierInformation
,
261 SystemSessionProcessesInformation
,
262 SystemLoadGdiDriverInSystemSpaceInformation
,
263 SystemNumaProcessorMap
,
264 SystemPrefetcherInformation
,
265 SystemExtendedProcessInformation
,
266 SystemRecommendedSharedDataAlignment
,
267 SystemComPlusPackage
,
268 SystemNumaAvailableMemory
,
269 SystemProcessorPowerInformation
,
270 SystemEmulationBasicInformation
,
271 SystemEmulationProcessorInformation
,
272 SystemExtendedHanfleInformation
,
273 SystemLostDelayedWriteInformation
,
274 SystemBigPoolInformation
,
275 SystemSessionPoolTagInformation
,
276 SystemSessionMappedViewInformation
,
277 SystemHotpatchInformation
,
278 SystemObjectSecurityMode
,
279 SystemWatchDogTimerHandler
,
280 SystemWatchDogTimerInformation
,
281 SystemLogicalProcessorInformation
,
282 SystemWow64SharedInformationObsolete
,
283 SystemRegisterFirmwareTableInformationHandler
,
284 SystemFirmwareTableInformation
,
285 SystemModuleInformationEx
,
286 SystemVerifierTriageInformation
,
287 SystemSuperfetchInformation
,
288 SystemMemoryListInformation
,
289 SystemFileCacheInformationEx
,
290 SystemThreadPriorityClientIdInformation
,
291 SystemProcessorIdleCycleTimeInformation
,
292 SystemVerifierCancellationInformation
,
293 SystemProcessorPowerInformationEx
,
294 SystemRefTraceInformation
,
295 SystemSpecialPoolInformation
,
296 SystemProcessIdInformation
,
297 SystemErrorPortInformation
,
298 SystemBootEnvironmentInformation
,
299 SystemHypervisorInformation
,
300 SystemVerifierInformationEx
,
301 SystemTimeZoneInformation
,
302 SystemImageFileExecutionOptionsInformation
,
303 SystemCoverageInformation
,
304 SystemPrefetchPathInformation
,
305 SystemVerifierFaultsInformation
,
307 } SYSTEM_INFORMATION_CLASS
;
310 // System Information Classes for NtQueryMutant
312 typedef enum _MUTANT_INFORMATION_CLASS
314 MutantBasicInformation
,
315 MutantOwnerInformation
316 } MUTANT_INFORMATION_CLASS
;
319 // System Information Classes for NtQueryAtom
321 typedef enum _ATOM_INFORMATION_CLASS
323 AtomBasicInformation
,
324 AtomTableInformation
,
325 } ATOM_INFORMATION_CLASS
;
328 // System Information Classes for NtQueryTimer
330 typedef enum _TIMER_INFORMATION_CLASS
332 TimerBasicInformation
333 } TIMER_INFORMATION_CLASS
;
336 // System Information Classes for NtQuerySemaphore
338 typedef enum _SEMAPHORE_INFORMATION_CLASS
340 SemaphoreBasicInformation
341 } SEMAPHORE_INFORMATION_CLASS
;
344 // System Information Classes for NtQueryEvent
346 typedef enum _EVENT_INFORMATION_CLASS
348 EventBasicInformation
349 } EVENT_INFORMATION_CLASS
;
351 #ifdef NTOS_MODE_USER
354 // Firmware Table Actions for SystemFirmwareTableInformation
356 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
358 SystemFirmwareTable_Enumerate
= 0,
359 SystemFirmwareTable_Get
= 1,
360 } SYSTEM_FIRMWARE_TABLE_ACTION
, *PSYSTEM_FIRMWARE_TABLE_ACTION
;
363 // Firmware Handler Callback
365 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
;
369 _In_
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
*FirmwareTableInformation
375 // Handle Enumeration Callback
377 struct _HANDLE_TABLE_ENTRY
;
379 (NTAPI
*PEX_ENUM_HANDLE_CALLBACK
)(
380 _In_
struct _HANDLE_TABLE_ENTRY
*HandleTableEntry
,
386 // Executive Work Queue Structures
388 typedef struct _EX_QUEUE_WORKER_INFO
390 ULONG QueueDisabled
:1;
391 ULONG MakeThreadsAsNecessary
:1;
393 ULONG WorkerCount
:29;
394 } EX_QUEUE_WORKER_INFO
, *PEX_QUEUE_WORKER_INFO
;
396 typedef struct _EX_WORK_QUEUE
399 LONG DynamicThreadCount
;
400 ULONG WorkItemsProcessed
;
401 ULONG WorkItemsProcessedLastPass
;
402 ULONG QueueDepthLastPass
;
403 EX_QUEUE_WORKER_INFO Info
;
404 } EX_WORK_QUEUE
, *PEX_WORK_QUEUE
;
407 // Executive Fast Reference Structure
409 typedef struct _EX_FAST_REF
417 } EX_FAST_REF
, *PEX_FAST_REF
;
420 // Executive Cache-Aware Rundown Reference Descriptor
422 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
424 PEX_RUNDOWN_REF RunRefs
;
428 } EX_RUNDOWN_REF_CACHE_AWARE
;
431 // Executive Rundown Wait Block
433 typedef struct _EX_RUNDOWN_WAIT_BLOCK
437 } EX_RUNDOWN_WAIT_BLOCK
, *PEX_RUNDOWN_WAIT_BLOCK
;
440 // Executive Pushlock
444 typedef struct _EX_PUSH_LOCK
453 ULONG_PTR MultipleShared
:1;
454 ULONG_PTR Shared
:sizeof (ULONG_PTR
) * 8 - 4;
459 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
462 // Executive Pushlock Wait Block
464 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
471 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Next
;
472 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Last
;
473 struct _EX_PUSH_LOCK_WAIT_BLOCK
*Previous
;
478 EX_PUSH_LOCK NewValue
;
479 EX_PUSH_LOCK OldValue
;
480 PEX_PUSH_LOCK PushLock
;
482 } EX_PUSH_LOCK_WAIT_BLOCK
, *PEX_PUSH_LOCK_WAIT_BLOCK
;
487 typedef struct _CALLBACK_OBJECT
491 LIST_ENTRY RegisteredCallbacks
;
492 BOOLEAN AllowMultipleCallbacks
;
499 typedef struct _CALLBACK_REGISTRATION
502 PCALLBACK_OBJECT CallbackObject
;
503 PCALLBACK_FUNCTION CallbackFunction
;
504 PVOID CallbackContext
;
506 BOOLEAN UnregisterWaiting
;
507 } CALLBACK_REGISTRATION
, *PCALLBACK_REGISTRATION
;
510 // Internal Callback Object
512 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
514 EX_RUNDOWN_REF RundownProtect
;
515 PEX_CALLBACK_FUNCTION Function
;
517 } EX_CALLBACK_ROUTINE_BLOCK
, *PEX_CALLBACK_ROUTINE_BLOCK
;
520 // Internal Callback Handle
522 typedef struct _EX_CALLBACK
524 EX_FAST_REF RoutineBlock
;
525 } EX_CALLBACK
, *PEX_CALLBACK
;
530 typedef struct _EPROFILE
538 PKPROFILE ProfileObject
;
539 PVOID LockedBufferAddress
;
542 KPROFILE_SOURCE ProfileSource
;
544 } EPROFILE
, *PEPROFILE
;
547 // Handle Table Structures
549 typedef struct _HANDLE_TRACE_DB_ENTRY
554 PVOID StackTrace
[16];
555 } HANDLE_TRACE_DB_ENTRY
, *PHANDLE_TRACE_DB_ENTRY
;
557 typedef struct _HANDLE_TRACE_DEBUG_INFO
562 FAST_MUTEX CloseCompatcionLock
;
563 ULONG CurrentStackIndex
;
564 HANDLE_TRACE_DB_ENTRY TraceDb
[1];
565 } HANDLE_TRACE_DEBUG_INFO
, *PHANDLE_TRACE_DEBUG_INFO
;
567 typedef struct _HANDLE_TABLE_ENTRY_INFO
570 } HANDLE_TABLE_ENTRY_INFO
, *PHANDLE_TABLE_ENTRY_INFO
;
572 typedef struct _HANDLE_TABLE_ENTRY
577 ULONG_PTR ObAttributes
;
578 PHANDLE_TABLE_ENTRY_INFO InfoTable
;
586 USHORT GrantedAccessIndex
;
587 USHORT CreatorBackTraceIndex
;
589 LONG NextFreeTableEntry
;
591 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
593 typedef struct _HANDLE_TABLE
595 #if (NTDDI_VERSION >= NTDDI_WINXP)
598 PHANDLE_TABLE_ENTRY
**Table
;
600 PEPROCESS QuotaProcess
;
601 PVOID UniqueProcessId
;
602 #if (NTDDI_VERSION >= NTDDI_WINXP)
603 EX_PUSH_LOCK HandleTableLock
[4];
604 LIST_ENTRY HandleTableList
;
605 EX_PUSH_LOCK HandleContentionEvent
;
607 ERESOURCE HandleLock
;
608 LIST_ENTRY HandleTableList
;
609 KEVENT HandleContentionEvent
;
611 PHANDLE_TRACE_DEBUG_INFO DebugInfo
;
613 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
619 LONG FirstFreeHandle
;
620 PHANDLE_TABLE_ENTRY LastFreeHandleEntry
;
622 ULONG NextHandleNeedingPool
;
626 ULONG NextHandleNeedingPool
;
634 } HANDLE_TABLE
, *PHANDLE_TABLE
;
639 // Hard Error LPC Message
641 typedef struct _HARDERROR_MSG
645 LARGE_INTEGER ErrorTime
;
646 ULONG ValidResponseOptions
;
648 ULONG NumberOfParameters
;
649 ULONG UnicodeStringParameterMask
;
650 ULONG_PTR Parameters
[MAXIMUM_HARDERROR_PARAMETERS
];
651 } HARDERROR_MSG
, *PHARDERROR_MSG
;
654 // Information Structures for NtQueryMutant
656 typedef struct _MUTANT_BASIC_INFORMATION
659 BOOLEAN OwnedByCaller
;
660 BOOLEAN AbandonedState
;
661 } MUTANT_BASIC_INFORMATION
, *PMUTANT_BASIC_INFORMATION
;
663 typedef struct _MUTANT_OWNER_INFORMATION
666 } MUTANT_OWNER_INFORMATION
, *PMUTANT_OWNER_INFORMATION
;
669 // Information Structures for NtQueryAtom
671 typedef struct _ATOM_BASIC_INFORMATION
677 } ATOM_BASIC_INFORMATION
, *PATOM_BASIC_INFORMATION
;
679 typedef struct _ATOM_TABLE_INFORMATION
683 } ATOM_TABLE_INFORMATION
, *PATOM_TABLE_INFORMATION
;
686 // Information Structures for NtQueryTimer
688 typedef struct _TIMER_BASIC_INFORMATION
690 LARGE_INTEGER TimeRemaining
;
692 } TIMER_BASIC_INFORMATION
, *PTIMER_BASIC_INFORMATION
;
695 // Information Structures for NtQuerySemaphore
697 typedef struct _SEMAPHORE_BASIC_INFORMATION
701 } SEMAPHORE_BASIC_INFORMATION
, *PSEMAPHORE_BASIC_INFORMATION
;
704 // Information Structures for NtQueryEvent
706 typedef struct _EVENT_BASIC_INFORMATION
708 EVENT_TYPE EventType
;
710 } EVENT_BASIC_INFORMATION
, *PEVENT_BASIC_INFORMATION
;
713 // Information Structures for NtQuerySystemInformation
715 typedef struct _SYSTEM_BASIC_INFORMATION
718 ULONG TimerResolution
;
720 ULONG NumberOfPhysicalPages
;
721 ULONG LowestPhysicalPageNumber
;
722 ULONG HighestPhysicalPageNumber
;
723 ULONG AllocationGranularity
;
724 ULONG_PTR MinimumUserModeAddress
;
725 ULONG_PTR MaximumUserModeAddress
;
726 ULONG_PTR ActiveProcessorsAffinityMask
;
727 CCHAR NumberOfProcessors
;
728 } SYSTEM_BASIC_INFORMATION
, *PSYSTEM_BASIC_INFORMATION
;
731 typedef struct _SYSTEM_PROCESSOR_INFORMATION
733 USHORT ProcessorArchitecture
;
734 USHORT ProcessorLevel
;
735 USHORT ProcessorRevision
;
737 ULONG ProcessorFeatureBits
;
738 } SYSTEM_PROCESSOR_INFORMATION
, *PSYSTEM_PROCESSOR_INFORMATION
;
741 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
743 LARGE_INTEGER IdleProcessTime
;
744 LARGE_INTEGER IoReadTransferCount
;
745 LARGE_INTEGER IoWriteTransferCount
;
746 LARGE_INTEGER IoOtherTransferCount
;
747 ULONG IoReadOperationCount
;
748 ULONG IoWriteOperationCount
;
749 ULONG IoOtherOperationCount
;
750 ULONG AvailablePages
;
751 ULONG CommittedPages
;
753 ULONG PeakCommitment
;
754 ULONG PageFaultCount
;
755 ULONG CopyOnWriteCount
;
756 ULONG TransitionCount
;
757 ULONG CacheTransitionCount
;
758 ULONG DemandZeroCount
;
760 ULONG PageReadIoCount
;
761 ULONG CacheReadCount
;
763 ULONG DirtyPagesWriteCount
;
764 ULONG DirtyWriteIoCount
;
765 ULONG MappedPagesWriteCount
;
766 ULONG MappedWriteIoCount
;
767 ULONG PagedPoolPages
;
768 ULONG NonPagedPoolPages
;
769 ULONG PagedPoolAllocs
;
770 ULONG PagedPoolFrees
;
771 ULONG NonPagedPoolAllocs
;
772 ULONG NonPagedPoolFrees
;
773 ULONG FreeSystemPtes
;
774 ULONG ResidentSystemCodePage
;
775 ULONG TotalSystemDriverPages
;
776 ULONG TotalSystemCodePages
;
777 ULONG NonPagedPoolLookasideHits
;
778 ULONG PagedPoolLookasideHits
;
780 ULONG ResidentSystemCachePage
;
781 ULONG ResidentPagedPoolPage
;
782 ULONG ResidentSystemDriverPage
;
783 ULONG CcFastReadNoWait
;
784 ULONG CcFastReadWait
;
785 ULONG CcFastReadResourceMiss
;
786 ULONG CcFastReadNotPossible
;
787 ULONG CcFastMdlReadNoWait
;
788 ULONG CcFastMdlReadWait
;
789 ULONG CcFastMdlReadResourceMiss
;
790 ULONG CcFastMdlReadNotPossible
;
791 ULONG CcMapDataNoWait
;
793 ULONG CcMapDataNoWaitMiss
;
794 ULONG CcMapDataWaitMiss
;
795 ULONG CcPinMappedDataCount
;
796 ULONG CcPinReadNoWait
;
798 ULONG CcPinReadNoWaitMiss
;
799 ULONG CcPinReadWaitMiss
;
800 ULONG CcCopyReadNoWait
;
801 ULONG CcCopyReadWait
;
802 ULONG CcCopyReadNoWaitMiss
;
803 ULONG CcCopyReadWaitMiss
;
804 ULONG CcMdlReadNoWait
;
806 ULONG CcMdlReadNoWaitMiss
;
807 ULONG CcMdlReadWaitMiss
;
808 ULONG CcReadAheadIos
;
809 ULONG CcLazyWriteIos
;
810 ULONG CcLazyWritePages
;
813 ULONG ContextSwitches
;
814 ULONG FirstLevelTbFills
;
815 ULONG SecondLevelTbFills
;
817 } SYSTEM_PERFORMANCE_INFORMATION
, *PSYSTEM_PERFORMANCE_INFORMATION
;
820 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
822 LARGE_INTEGER BootTime
;
823 LARGE_INTEGER CurrentTime
;
824 LARGE_INTEGER TimeZoneBias
;
827 #if (NTDDI_VERSION >= NTDDI_WIN2K)
828 ULONGLONG BootTimeBias
;
829 ULONGLONG SleepTimeBias
;
831 } SYSTEM_TIMEOFDAY_INFORMATION
, *PSYSTEM_TIMEOFDAY_INFORMATION
;
834 // This class is obsolete, please use KUSER_SHARED_DATA instead
837 typedef struct _SYSTEM_THREAD_INFORMATION
839 LARGE_INTEGER KernelTime
;
840 LARGE_INTEGER UserTime
;
841 LARGE_INTEGER CreateTime
;
847 ULONG ContextSwitches
;
850 ULONG PadPadAlignment
;
851 } SYSTEM_THREAD_INFORMATION
, *PSYSTEM_THREAD_INFORMATION
;
853 C_ASSERT(sizeof(SYSTEM_THREAD_INFORMATION
) == 0x40); // Must be 8-byte aligned
856 typedef struct _SYSTEM_PROCESS_INFORMATION
858 ULONG NextEntryOffset
;
859 ULONG NumberOfThreads
;
860 LARGE_INTEGER WorkingSetPrivateSize
; //VISTA
861 ULONG HardFaultCount
; //WIN7
862 ULONG NumberOfThreadsHighWatermark
; //WIN7
863 ULONGLONG CycleTime
; //WIN7
864 LARGE_INTEGER CreateTime
;
865 LARGE_INTEGER UserTime
;
866 LARGE_INTEGER KernelTime
;
867 UNICODE_STRING ImageName
;
868 KPRIORITY BasePriority
;
869 HANDLE UniqueProcessId
;
870 HANDLE InheritedFromUniqueProcessId
;
873 ULONG_PTR PageDirectoryBase
;
876 // This part corresponds to VM_COUNTERS_EX.
877 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
879 SIZE_T PeakVirtualSize
;
881 ULONG PageFaultCount
;
882 SIZE_T PeakWorkingSetSize
;
883 SIZE_T WorkingSetSize
;
884 SIZE_T QuotaPeakPagedPoolUsage
;
885 SIZE_T QuotaPagedPoolUsage
;
886 SIZE_T QuotaPeakNonPagedPoolUsage
;
887 SIZE_T QuotaNonPagedPoolUsage
;
888 SIZE_T PagefileUsage
;
889 SIZE_T PeakPagefileUsage
;
890 SIZE_T PrivatePageCount
;
893 // This part corresponds to IO_COUNTERS
895 LARGE_INTEGER ReadOperationCount
;
896 LARGE_INTEGER WriteOperationCount
;
897 LARGE_INTEGER OtherOperationCount
;
898 LARGE_INTEGER ReadTransferCount
;
899 LARGE_INTEGER WriteTransferCount
;
900 LARGE_INTEGER OtherTransferCount
;
901 // SYSTEM_THREAD_INFORMATION TH[1];
902 } SYSTEM_PROCESS_INFORMATION
, *PSYSTEM_PROCESS_INFORMATION
;
904 C_ASSERT(sizeof(SYSTEM_PROCESS_INFORMATION
) == 0xB8); // Must be 8-byte aligned
909 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
912 ULONG NumberOfTables
;
913 } SYSTEM_CALL_COUNT_INFORMATION
, *PSYSTEM_CALL_COUNT_INFORMATION
;
916 typedef struct _SYSTEM_DEVICE_INFORMATION
919 ULONG NumberOfFloppies
;
920 ULONG NumberOfCdRoms
;
922 ULONG NumberOfSerialPorts
;
923 ULONG NumberOfParallelPorts
;
924 } SYSTEM_DEVICE_INFORMATION
, *PSYSTEM_DEVICE_INFORMATION
;
927 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
929 LARGE_INTEGER IdleTime
;
930 LARGE_INTEGER KernelTime
;
931 LARGE_INTEGER UserTime
;
932 LARGE_INTEGER DpcTime
;
933 LARGE_INTEGER InterruptTime
;
934 ULONG InterruptCount
;
935 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
;
938 typedef struct _SYSTEM_FLAGS_INFORMATION
941 } SYSTEM_FLAGS_INFORMATION
, *PSYSTEM_FLAGS_INFORMATION
;
944 typedef struct _SYSTEM_CALL_TIME_INFORMATION
948 LARGE_INTEGER TimeOfCalls
[1];
949 } SYSTEM_CALL_TIME_INFORMATION
, *PSYSTEM_CALL_TIME_INFORMATION
;
951 // Class 11 - See RTL_PROCESS_MODULES
953 // Class 12 - See RTL_PROCESS_LOCKS
955 // Class 13 - See RTL_PROCESS_BACKTRACES
958 typedef struct _SYSTEM_POOL_ENTRY
962 USHORT AllocatorBackTraceIndex
;
968 PVOID ProcessChargedQuota
;
970 } SYSTEM_POOL_ENTRY
, *PSYSTEM_POOL_ENTRY
;
972 typedef struct _SYSTEM_POOL_INFORMATION
976 USHORT EntryOverhead
;
977 BOOLEAN PoolTagPresent
;
979 ULONG NumberOfEntries
;
980 SYSTEM_POOL_ENTRY Entries
[1];
981 } SYSTEM_POOL_INFORMATION
, *PSYSTEM_POOL_INFORMATION
;
984 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
986 USHORT UniqueProcessId
;
987 USHORT CreatorBackTraceIndex
;
988 UCHAR ObjectTypeIndex
;
989 UCHAR HandleAttributes
;
993 } SYSTEM_HANDLE_TABLE_ENTRY_INFO
, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO
;
995 typedef struct _SYSTEM_HANDLE_INFORMATION
997 ULONG NumberOfHandles
;
998 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles
[1];
999 } SYSTEM_HANDLE_INFORMATION
, *PSYSTEM_HANDLE_INFORMATION
;
1002 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
1004 ULONG NextEntryOffset
;
1005 ULONG NumberOfObjects
;
1006 ULONG NumberOfHandles
;
1008 ULONG InvalidAttributes
;
1009 GENERIC_MAPPING GenericMapping
;
1010 ULONG ValidAccessMask
;
1012 BOOLEAN SecurityRequired
;
1013 BOOLEAN WaitableObject
;
1014 UNICODE_STRING TypeName
;
1015 } SYSTEM_OBJECTTYPE_INFORMATION
, *PSYSTEM_OBJECTTYPE_INFORMATION
;
1017 typedef struct _SYSTEM_OBJECT_INFORMATION
1019 ULONG NextEntryOffset
;
1021 HANDLE CreatorUniqueProcess
;
1022 USHORT CreatorBackTraceIndex
;
1026 ULONG PagedPoolCharge
;
1027 ULONG NonPagedPoolCharge
;
1028 HANDLE ExclusiveProcessId
;
1029 PVOID SecurityDescriptor
;
1030 OBJECT_NAME_INFORMATION NameInfo
;
1031 } SYSTEM_OBJECT_INFORMATION
, *PSYSTEM_OBJECT_INFORMATION
;
1034 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1036 ULONG NextEntryOffset
;
1040 UNICODE_STRING PageFileName
;
1041 } SYSTEM_PAGEFILE_INFORMATION
, *PSYSTEM_PAGEFILE_INFORMATION
;
1044 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1046 ULONG SegmentNotPresent
;
1048 ULONG OpcodeESPrefix
;
1049 ULONG OpcodeCSPrefix
;
1050 ULONG OpcodeSSPrefix
;
1051 ULONG OpcodeDSPrefix
;
1052 ULONG OpcodeFSPrefix
;
1053 ULONG OpcodeGSPrefix
;
1054 ULONG OpcodeOPER32Prefix
;
1055 ULONG OpcodeADDR32Prefix
;
1067 ULONG OpcodeOUTBimm
;
1068 ULONG OpcodeOUTWimm
;
1073 ULONG OpcodeLOCKPrefix
;
1074 ULONG OpcodeREPNEPrefix
;
1075 ULONG OpcodeREPPrefix
;
1080 } SYSTEM_VDM_INSTEMUL_INFO
, *PSYSTEM_VDM_INSTEMUL_INFO
;
1082 // Class 20 - ULONG VDMBOPINFO
1085 typedef struct _SYSTEM_FILECACHE_INFORMATION
1089 ULONG PageFaultCount
;
1090 SIZE_T MinimumWorkingSet
;
1091 SIZE_T MaximumWorkingSet
;
1092 SIZE_T CurrentSizeIncludingTransitionInPages
;
1093 SIZE_T PeakSizeIncludingTransitionInPages
;
1094 ULONG TransitionRePurposeCount
;
1096 } SYSTEM_FILECACHE_INFORMATION
, *PSYSTEM_FILECACHE_INFORMATION
;
1099 typedef struct _SYSTEM_POOLTAG
1109 ULONG NonPagedAllocs
;
1110 ULONG NonPagedFrees
;
1111 SIZE_T NonPagedUsed
;
1112 } SYSTEM_POOLTAG
, *PSYSTEM_POOLTAG
;
1114 typedef struct _SYSTEM_POOLTAG_INFORMATION
1117 SYSTEM_POOLTAG TagInfo
[1];
1118 } SYSTEM_POOLTAG_INFORMATION
, *PSYSTEM_POOLTAG_INFORMATION
;
1121 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1123 ULONG ContextSwitches
;
1126 ULONG TimeIncrement
;
1127 ULONG DpcBypassCount
;
1128 ULONG ApcBypassCount
;
1129 } SYSTEM_INTERRUPT_INFORMATION
, *PSYSTEM_INTERRUPT_INFORMATION
;
1132 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1135 ULONG DpcQueueDepth
;
1136 ULONG MinimumDpcRate
;
1137 ULONG AdjustDpcThreshold
;
1139 } SYSTEM_DPC_BEHAVIOR_INFORMATION
, *PSYSTEM_DPC_BEHAVIOR_INFORMATION
;
1142 typedef struct _SYSTEM_MEMORY_INFO
1144 PUCHAR StringOffset
;
1146 USHORT TransitionCount
;
1147 USHORT ModifiedCount
;
1148 USHORT PageTableCount
;
1149 } SYSTEM_MEMORY_INFO
, *PSYSTEM_MEMORY_INFO
;
1151 typedef struct _SYSTEM_MEMORY_INFORMATION
1155 SYSTEM_MEMORY_INFO Memory
[1];
1156 } SYSTEM_MEMORY_INFORMATION
, *PSYSTEM_MEMORY_INFORMATION
;
1159 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1161 UNICODE_STRING DriverName
;
1163 PVOID SectionPointer
;
1165 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
;
1167 } SYSTEM_GDI_DRIVER_INFORMATION
, *PSYSTEM_GDI_DRIVER_INFORMATION
;
1170 // Not an actually class, simply a PVOID to the ImageAddress
1173 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1175 ULONG TimeAdjustment
;
1176 ULONG TimeIncrement
;
1178 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION
, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
;
1180 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1182 ULONG TimeAdjustment
;
1184 } SYSTEM_SET_TIME_ADJUST_INFORMATION
, *PSYSTEM_SET_TIME_ADJUST_INFORMATION
;
1186 // Class 29 - Same as 25
1191 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1194 UCHAR TracePermanent
;
1195 UNICODE_STRING TraceProcessName
;
1196 UNICODE_STRING TracePoolTags
;
1197 } SYSTEM_REF_TRACE_INFORMATION
, *PSYSTEM_REF_TRACE_INFORMATION
;
1199 // Class 32 - OBSOLETE
1202 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1204 ULONG AlignmentFixupCount
;
1205 ULONG ExceptionDispatchCount
;
1206 ULONG FloatingEmulationCount
;
1207 ULONG ByteWordEmulationCount
;
1208 } SYSTEM_EXCEPTION_INFORMATION
, *PSYSTEM_EXCEPTION_INFORMATION
;
1211 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1213 ULONG ValidCrashDump
;
1214 } SYSTEM_CRASH_STATE_INFORMATION
, *PSYSTEM_CRASH_STATE_INFORMATION
;
1217 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1219 BOOLEAN KernelDebuggerEnabled
;
1220 BOOLEAN KernelDebuggerNotPresent
;
1221 } SYSTEM_KERNEL_DEBUGGER_INFORMATION
, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION
;
1224 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1226 ULONG ContextSwitches
;
1235 ULONG PreemptCurrent
;
1238 } SYSTEM_CONTEXT_SWITCH_INFORMATION
, *PSYSTEM_CONTEXT_SWITCH_INFORMATION
;
1241 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1243 ULONG RegistryQuotaAllowed
;
1244 ULONG RegistryQuotaUsed
;
1245 SIZE_T PagedPoolSize
;
1246 } SYSTEM_REGISTRY_QUOTA_INFORMATION
, *PSYSTEM_REGISTRY_QUOTA_INFORMATION
;
1249 // Not a structure, simply send the UNICODE_STRING
1252 // Not a structure, simply send a ULONG containing the new separation
1255 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1258 PLUGPLAY_BUS_INSTANCE BusInstance
[1];
1259 } SYSTEM_PLUGPLAY_BUS_INFORMATION
, *PSYSTEM_PLUGPLAY_BUS_INFORMATION
;
1262 typedef struct _SYSTEM_DOCK_INFORMATION
1264 SYSTEM_DOCK_STATE DockState
;
1265 INTERFACE_TYPE DeviceBusType
;
1266 ULONG DeviceBusNumber
;
1268 } SYSTEM_DOCK_INFORMATION
, *PSYSTEM_DOCK_INFORMATION
;
1271 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1273 BOOLEAN SystemSuspendSupported
;
1274 BOOLEAN SystemHibernateSupported
;
1275 BOOLEAN ResumeTimerSupportsSuspend
;
1276 BOOLEAN ResumeTimerSupportsHibernate
;
1277 BOOLEAN LidSupported
;
1278 BOOLEAN TurboSettingSupported
;
1280 BOOLEAN SystemAcOrDc
;
1281 BOOLEAN PowerDownDisabled
;
1282 LARGE_INTEGER SpindownDrives
;
1283 } SYSTEM_POWER_INFORMATION_NATIVE
, *PSYSTEM_POWER_INFORMATION_NATIVE
;
1286 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1288 PNP_VETO_TYPE VetoType
;
1289 UNICODE_STRING VetoDriver
;
1290 } SYSTEM_LEGACY_DRIVER_INFORMATION
, *PSYSTEM_LEGACY_DRIVER_INFORMATION
;
1293 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1296 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1298 USHORT CurrentDepth
;
1299 USHORT MaximumDepth
;
1300 ULONG TotalAllocates
;
1301 ULONG AllocateMisses
;
1307 } SYSTEM_LOOKASIDE_INFORMATION
, *PSYSTEM_LOOKASIDE_INFORMATION
;
1310 // Not a structure. Only a HANDLE for the SlipEvent;
1313 // Not a structure. Only a ULONG for the SessionId;
1316 // Not a structure. Only a ULONG for the SessionId;
1321 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1324 typedef struct _SYSTEM_VERIFIER_INFORMATION
1326 ULONG NextEntryOffset
;
1328 UNICODE_STRING DriverName
;
1330 ULONG AcquireSpinLocks
;
1331 ULONG SynchronizeExecutions
;
1332 ULONG AllocationsAttempted
;
1333 ULONG AllocationsSucceeded
;
1334 ULONG AllocationsSucceededSpecialPool
;
1335 ULONG AllocationsWithNoTag
;
1338 ULONG AllocationsFailed
;
1339 ULONG AllocationsFailedDeliberately
;
1342 ULONG UnTrackedPool
;
1343 ULONG CurrentPagedPoolAllocations
;
1344 ULONG CurrentNonPagedPoolAllocations
;
1345 ULONG PeakPagedPoolAllocations
;
1346 ULONG PeakNonPagedPoolAllocations
;
1347 SIZE_T PagedPoolUsageInBytes
;
1348 SIZE_T NonPagedPoolUsageInBytes
;
1349 SIZE_T PeakPagedPoolUsageInBytes
;
1350 SIZE_T PeakNonPagedPoolUsageInBytes
;
1351 } SYSTEM_VERIFIER_INFORMATION
, *PSYSTEM_VERIFIER_INFORMATION
;
1356 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1360 PVOID Buffer
; // Same format as in SystemProcessInformation
1361 } SYSTEM_SESSION_PROCESS_INFORMATION
, *PSYSTEM_SESSION_PROCESS_INFORMATION
;
1363 // FIXME: Class 54-97
1368 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1369 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1370 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1371 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1372 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1373 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1377 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1396 USHORT TargetNameOffset
;
1397 USHORT TargetNameLength
;
1398 UCHAR PatchingFinished
;
1404 USHORT TargetNameOffset
;
1405 USHORT TargetNameLength
;
1406 UCHAR PatchingFinished
;
1407 NTSTATUS ReturnCode
;
1408 HANDLE TargetProcess
;
1413 PIO_STATUS_BLOCK IoStatusBlock1
;
1414 PVOID RenameInformation1
;
1415 PVOID RenameInformationLength1
;
1417 PIO_STATUS_BLOCK IoStatusBlock2
;
1418 PVOID RenameInformation2
;
1419 PVOID RenameInformationLength2
;
1423 HANDLE ParentDirectory
;
1424 HANDLE ObjectHandle1
;
1425 HANDLE ObjectHandle2
;
1428 } SYSTEM_HOTPATCH_CODE_INFORMATION
, *PSYSTEM_HOTPATCH_CODE_INFORMATION
;
1433 #ifdef NTOS_MODE_USER
1434 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1436 ULONG ProviderSignature
;
1438 PFNFTH FirmwareTableHandler
;
1440 } SYSTEM_FIRMWARE_TABLE_HANDLER
, *PSYSTEM_FIRMWARE_TABLE_HANDLER
;
1445 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1447 ULONG ProviderSignature
;
1448 SYSTEM_FIRMWARE_TABLE_ACTION Action
;
1450 ULONG TableBufferLength
;
1451 UCHAR TableBuffer
[1];
1452 } SYSTEM_FIRMWARE_TABLE_INFORMATION
, *PSYSTEM_FIRMWARE_TABLE_INFORMATION
;
1457 typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
1459 SIZE_T ZeroPageCount
;
1460 SIZE_T FreePageCount
;
1461 SIZE_T ModifiedPageCount
;
1462 SIZE_T ModifiedNoWritePageCount
;
1463 SIZE_T BadPageCount
;
1464 SIZE_T PageCountByPriority
[8];
1465 SIZE_T RepurposedPagesByPriority
[8];
1466 SIZE_T ModifiedPageCountPageFile
;
1467 } SYSTEM_MEMORY_LIST_INFORMATION
, *PSYSTEM_MEMORY_LIST_INFORMATION
;
1469 #endif // !NTOS_MODE_USER
1475 #endif // !_EXTYPES_H