Correction to 36917: EPROFILE/KPROFILE.Segment is pointer sized, not a pointer.
[reactos.git] / reactos / include / ndk / extypes.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 extypes.h
8
9 Abstract:
10
11 Type definitions for the Executive.
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _EXTYPES_H
20 #define _EXTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <cfg.h>
27 #if !defined(NTOS_MODE_USER)
28 #include <ntimage.h>
29 #endif
30 #include <cmtypes.h>
31 #include <ketypes.h>
32 #include <potypes.h>
33 #include <lpctypes.h>
34 #ifdef NTOS_MODE_USER
35 #include <obtypes.h>
36 #endif
37
38 //
39 // GCC compatibility
40 //
41 #if defined(__GNUC__)
42 #define __ALIGNED(n) __attribute__((aligned (n)))
43 #elif defined(_MSC_VER)
44 #define __ALIGNED(n) __declspec(align(n))
45 #else
46 #error __ALIGNED not defined for your compiler!
47 #endif
48
49 //
50 // Rtl Atom
51 //
52 typedef USHORT RTL_ATOM, *PRTL_ATOM;
53
54 #ifndef NTOS_MODE_USER
55
56 //
57 // Kernel Exported Object Types
58 //
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;
64
65 //
66 // Exported NT Build Number
67 //
68 extern ULONG NtBuildNumber;
69
70 //
71 // Invalid Handle Value Constant
72 //
73 #define INVALID_HANDLE_VALUE (HANDLE)-1
74
75 #endif
76
77 //
78 // Increments
79 //
80 #define MUTANT_INCREMENT 1
81
82 //
83 // Callback Object Access Mask
84 //
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)
89
90 //
91 // Event Object Access Masks
92 //
93 #ifdef NTOS_MODE_USER
94 #define EVENT_QUERY_STATE 0x0001
95
96 //
97 // Semaphore Object Access Masks
98 //
99 #define SEMAPHORE_QUERY_STATE 0x0001
100 #else
101
102 //
103 // Mutant Object Access Masks
104 //
105 #define MUTANT_QUERY_STATE 0x0001
106 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
107 SYNCHRONIZE | \
108 MUTANT_QUERY_STATE)
109
110 #define TIMER_QUERY_STATE 0x0001
111 #define TIMER_MODIFY_STATE 0x0002
112 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
113 SYNCHRONIZE | \
114 TIMER_QUERY_STATE | \
115 TIMER_MODIFY_STATE)
116 #endif
117
118 //
119 // Event Pair Access Masks
120 //
121 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
122
123 //
124 // Profile Object Access Masks
125 //
126 #define PROFILE_CONTROL 0x0001
127 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
128
129 //
130 // Maximum Parameters for NtRaiseHardError
131 //
132 #define MAXIMUM_HARDERROR_PARAMETERS 4
133
134 //
135 // Pushlock bits
136 //
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)
144
145 //
146 // Pushlock Wait Block Flags
147 //
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
151
152 //
153 // Resource (ERESOURCE) Flags
154 //
155 #define ResourceHasDisabledPriorityBoost 0x08
156
157 //
158 // Shutdown types for NtShutdownSystem
159 //
160 typedef enum _SHUTDOWN_ACTION
161 {
162 ShutdownNoReboot,
163 ShutdownReboot,
164 ShutdownPowerOff
165 } SHUTDOWN_ACTION;
166
167 //
168 // Responses for NtRaiseHardError
169 //
170 typedef enum _HARDERROR_RESPONSE_OPTION
171 {
172 OptionAbortRetryIgnore,
173 OptionOk,
174 OptionOkCancel,
175 OptionRetryCancel,
176 OptionYesNo,
177 OptionYesNoCancel,
178 OptionShutdownSystem
179 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
180
181 typedef enum _HARDERROR_RESPONSE
182 {
183 ResponseReturnToCaller,
184 ResponseNotHandled,
185 ResponseAbort,
186 ResponseCancel,
187 ResponseIgnore,
188 ResponseNo,
189 ResponseOk,
190 ResponseRetry,
191 ResponseYes,
192 ResponseTryAgain,
193 ResponseContinue
194 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
195
196 //
197 // System Information Classes for NtQuerySystemInformation
198 //
199 typedef enum _SYSTEM_INFORMATION_CLASS
200 {
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,
233 SystemObsolete0,
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,
248 SystemSessionCreate,
249 SystemSessionDetach,
250 SystemSessionInformation,
251 SystemRangeStartInformation,
252 SystemVerifierInformation,
253 SystemAddVerifier,
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,
299 MaxSystemInfoClass,
300 } SYSTEM_INFORMATION_CLASS;
301
302 //
303 // System Information Classes for NtQueryMutant
304 //
305 typedef enum _MUTANT_INFORMATION_CLASS
306 {
307 MutantBasicInformation,
308 MutantOwnerInformation
309 } MUTANT_INFORMATION_CLASS;
310
311 //
312 // System Information Classes for NtQueryAtom
313 //
314 typedef enum _ATOM_INFORMATION_CLASS
315 {
316 AtomBasicInformation,
317 AtomTableInformation,
318 } ATOM_INFORMATION_CLASS;
319
320 //
321 // System Information Classes for NtQueryTimer
322 //
323 typedef enum _TIMER_INFORMATION_CLASS
324 {
325 TimerBasicInformation
326 } TIMER_INFORMATION_CLASS;
327
328 //
329 // System Information Classes for NtQuerySemaphore
330 //
331 typedef enum _SEMAPHORE_INFORMATION_CLASS
332 {
333 SemaphoreBasicInformation
334 } SEMAPHORE_INFORMATION_CLASS;
335
336 //
337 // System Information Classes for NtQueryEvent
338 //
339 typedef enum _EVENT_INFORMATION_CLASS
340 {
341 EventBasicInformation
342 } EVENT_INFORMATION_CLASS;
343
344 #ifdef NTOS_MODE_USER
345
346 //
347 // Firmware Table Actions for SystemFirmwareTableInformation
348 //
349 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
350 {
351 SystemFirmwareTable_Enumerate = 0,
352 SystemFirmwareTable_Get = 1,
353 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
354
355 //
356 // Firmware Handler Callback
357 //
358 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION;
359 typedef
360 NTSTATUS
361 (__cdecl *PFNFTH)(
362 IN struct _SYSTEM_FIRMWARE_TABLE_INFORMATION *FirmwareTableInformation
363 );
364
365 #else
366
367 //
368 // Handle Enumeration Callback
369 //
370 struct _HANDLE_TABLE_ENTRY;
371 typedef BOOLEAN
372 (NTAPI *PEX_ENUM_HANDLE_CALLBACK)(
373 IN struct _HANDLE_TABLE_ENTRY *HandleTableEntry,
374 IN HANDLE Handle,
375 IN PVOID Context
376 );
377
378 //
379 // Executive Work Queue Structures
380 //
381 typedef struct _EX_QUEUE_WORKER_INFO
382 {
383 ULONG QueueDisabled:1;
384 ULONG MakeThreadsAsNecessary:1;
385 ULONG WaitMode:1;
386 ULONG WorkerCount:29;
387 } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;
388
389 typedef struct _EX_WORK_QUEUE
390 {
391 KQUEUE WorkerQueue;
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;
398
399 //
400 // Executive Fast Reference Structure
401 //
402 typedef struct _EX_FAST_REF
403 {
404 union
405 {
406 PVOID Object;
407 ULONG_PTR RefCnt:3;
408 ULONG_PTR Value;
409 };
410 } EX_FAST_REF, *PEX_FAST_REF;
411
412 //
413 // Executive Cache-Aware Rundown Reference Descriptor
414 //
415 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
416 {
417 PEX_RUNDOWN_REF RunRefs;
418 PVOID PoolToFree;
419 ULONG RunRefSize;
420 ULONG Number;
421 } EX_RUNDOWN_REF_CACHE_AWARE;
422
423 //
424 // Executive Rundown Wait Block
425 //
426 typedef struct _EX_RUNDOWN_WAIT_BLOCK
427 {
428 ULONG_PTR Count;
429 KEVENT WakeEvent;
430 } EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
431
432 //
433 // Executive Pushlock
434 //
435 #undef EX_PUSH_LOCK
436 #undef PEX_PUSH_LOCK
437 typedef struct _EX_PUSH_LOCK
438 {
439 union
440 {
441 struct
442 {
443 ULONG_PTR Locked:1;
444 ULONG_PTR Waiting:1;
445 ULONG_PTR Waking:1;
446 ULONG_PTR MultipleShared:1;
447 ULONG_PTR Shared:sizeof (ULONG_PTR) * 8 - 4;
448 };
449 ULONG_PTR Value;
450 PVOID Ptr;
451 };
452 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
453
454 //
455 // Executive Pushlock Wait Block
456 //
457 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
458 {
459 union
460 {
461 KGATE WakeGate;
462 KEVENT WakeEvent;
463 };
464 struct _EX_PUSH_LOCK_WAIT_BLOCK *Next;
465 struct _EX_PUSH_LOCK_WAIT_BLOCK *Last;
466 struct _EX_PUSH_LOCK_WAIT_BLOCK *Previous;
467 LONG ShareCount;
468 LONG Flags;
469 #if DBG
470 BOOLEAN Signaled;
471 EX_PUSH_LOCK NewValue;
472 EX_PUSH_LOCK OldValue;
473 PEX_PUSH_LOCK PushLock;
474 #endif
475 } EX_PUSH_LOCK_WAIT_BLOCK, *PEX_PUSH_LOCK_WAIT_BLOCK;
476
477 //
478 // Callback Object
479 //
480 typedef struct _CALLBACK_OBJECT
481 {
482 ULONG Signature;
483 KSPIN_LOCK Lock;
484 LIST_ENTRY RegisteredCallbacks;
485 BOOLEAN AllowMultipleCallbacks;
486 UCHAR reserved[3];
487 } CALLBACK_OBJECT;
488
489 //
490 // Callback Handle
491 //
492 typedef struct _CALLBACK_REGISTRATION
493 {
494 LIST_ENTRY Link;
495 PCALLBACK_OBJECT CallbackObject;
496 PCALLBACK_FUNCTION CallbackFunction;
497 PVOID CallbackContext;
498 ULONG Busy;
499 BOOLEAN UnregisterWaiting;
500 } CALLBACK_REGISTRATION, *PCALLBACK_REGISTRATION;
501
502 //
503 // Internal Callback Object
504 //
505 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
506 {
507 EX_RUNDOWN_REF RundownProtect;
508 PEX_CALLBACK_FUNCTION Function;
509 PVOID Context;
510 } EX_CALLBACK_ROUTINE_BLOCK, *PEX_CALLBACK_ROUTINE_BLOCK;
511
512 //
513 // Internal Callback Handle
514 //
515 typedef struct _EX_CALLBACK
516 {
517 EX_FAST_REF RoutineBlock;
518 } EX_CALLBACK, *PEX_CALLBACK;
519
520 //
521 // Profile Object
522 //
523 typedef struct _EPROFILE
524 {
525 PEPROCESS Process;
526 PVOID RangeBase;
527 SIZE_T RangeSize;
528 PVOID Buffer;
529 ULONG BufferSize;
530 ULONG BucketSize;
531 PKPROFILE ProfileObject;
532 PVOID LockedBufferAddress;
533 PMDL Mdl;
534 ULONG_PTR Segment;
535 KPROFILE_SOURCE ProfileSource;
536 KAFFINITY Affinity;
537 } EPROFILE, *PEPROFILE;
538
539 //
540 // Handle Table Structures
541 //
542 typedef struct _HANDLE_TRACE_DB_ENTRY
543 {
544 CLIENT_ID ClientId;
545 HANDLE Handle;
546 ULONG Type;
547 PVOID StackTrace[16];
548 } HANDLE_TRACE_DB_ENTRY, *PHANDLE_TRACE_DB_ENTRY;
549
550 typedef struct _HANDLE_TRACE_DEBUG_INFO
551 {
552 LONG RefCount;
553 ULONG TableSize;
554 ULONG BitMaskFlags;
555 FAST_MUTEX CloseCompatcionLock;
556 ULONG CurrentStackIndex;
557 HANDLE_TRACE_DB_ENTRY TraceDb[1];
558 } HANDLE_TRACE_DEBUG_INFO, *PHANDLE_TRACE_DEBUG_INFO;
559
560 typedef struct _HANDLE_TABLE_ENTRY_INFO
561 {
562 ULONG AuditMask;
563 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
564
565 typedef struct _HANDLE_TABLE_ENTRY
566 {
567 union
568 {
569 PVOID Object;
570 ULONG_PTR ObAttributes;
571 PHANDLE_TABLE_ENTRY_INFO InfoTable;
572 ULONG_PTR Value;
573 };
574 union
575 {
576 ULONG GrantedAccess;
577 struct
578 {
579 USHORT GrantedAccessIndex;
580 USHORT CreatorBackTraceIndex;
581 };
582 LONG NextFreeTableEntry;
583 };
584 } HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
585
586 typedef struct _HANDLE_TABLE
587 {
588 #if (NTDDI_VERSION >= NTDDI_WINXP)
589 ULONG TableCode;
590 #else
591 PHANDLE_TABLE_ENTRY **Table;
592 #endif
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;
599 #else
600 ERESOURCE HandleLock;
601 LIST_ENTRY HandleTableList;
602 KEVENT HandleContentionEvent;
603 #endif
604 PHANDLE_TRACE_DEBUG_INFO DebugInfo;
605 LONG ExtraInfoPages;
606 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
607 union
608 {
609 ULONG Flags;
610 UCHAR StrictFIFO:1;
611 };
612 LONG FirstFreeHandle;
613 PHANDLE_TABLE_ENTRY LastFreeHandleEntry;
614 LONG HandleCount;
615 ULONG NextHandleNeedingPool;
616 #else
617 ULONG FirstFree;
618 ULONG LastFree;
619 ULONG NextHandleNeedingPool;
620 LONG HandleCount;
621 union
622 {
623 ULONG Flags;
624 UCHAR StrictFIFO:1;
625 };
626 #endif
627 } HANDLE_TABLE, *PHANDLE_TABLE;
628
629 #endif
630
631 //
632 // Hard Error LPC Message
633 //
634 typedef struct _HARDERROR_MSG
635 {
636 PORT_MESSAGE h;
637 NTSTATUS Status;
638 LARGE_INTEGER ErrorTime;
639 ULONG ValidResponseOptions;
640 ULONG Response;
641 ULONG NumberOfParameters;
642 ULONG UnicodeStringParameterMask;
643 ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
644 } HARDERROR_MSG, *PHARDERROR_MSG;
645
646 //
647 // Information Structures for NtQueryMutant
648 //
649 typedef struct _MUTANT_BASIC_INFORMATION
650 {
651 LONG CurrentCount;
652 BOOLEAN OwnedByCaller;
653 BOOLEAN AbandonedState;
654 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
655
656 typedef struct _MUTANT_OWNER_INFORMATION
657 {
658 CLIENT_ID ClientId;
659 } MUTANT_OWNER_INFORMATION, *PMUTANT_OWNER_INFORMATION;
660
661 //
662 // Information Structures for NtQueryAtom
663 //
664 typedef struct _ATOM_BASIC_INFORMATION
665 {
666 USHORT UsageCount;
667 USHORT Flags;
668 USHORT NameLength;
669 WCHAR Name[1];
670 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
671
672 typedef struct _ATOM_TABLE_INFORMATION
673 {
674 ULONG NumberOfAtoms;
675 USHORT Atoms[1];
676 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
677
678 //
679 // Information Structures for NtQueryTimer
680 //
681 typedef struct _TIMER_BASIC_INFORMATION
682 {
683 LARGE_INTEGER TimeRemaining;
684 BOOLEAN SignalState;
685 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
686
687 //
688 // Information Structures for NtQuerySemaphore
689 //
690 typedef struct _SEMAPHORE_BASIC_INFORMATION
691 {
692 LONG CurrentCount;
693 LONG MaximumCount;
694 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
695
696 //
697 // Information Structures for NtQueryEvent
698 //
699 typedef struct _EVENT_BASIC_INFORMATION
700 {
701 EVENT_TYPE EventType;
702 LONG EventState;
703 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
704
705 //
706 // Information Structures for NtQuerySystemInformation
707 //
708 typedef struct _SYSTEM_BASIC_INFORMATION
709 {
710 ULONG Reserved;
711 ULONG TimerResolution;
712 ULONG PageSize;
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;
722
723 // Class 1
724 typedef struct _SYSTEM_PROCESSOR_INFORMATION
725 {
726 USHORT ProcessorArchitecture;
727 USHORT ProcessorLevel;
728 USHORT ProcessorRevision;
729 USHORT Reserved;
730 ULONG ProcessorFeatureBits;
731 } SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
732
733 // Class 2
734 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
735 {
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;
745 ULONG CommitLimit;
746 ULONG PeakCommitment;
747 ULONG PageFaultCount;
748 ULONG CopyOnWriteCount;
749 ULONG TransitionCount;
750 ULONG CacheTransitionCount;
751 ULONG DemandZeroCount;
752 ULONG PageReadCount;
753 ULONG PageReadIoCount;
754 ULONG CacheReadCount;
755 ULONG CacheIoCount;
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;
772 ULONG Spare3Count;
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;
785 ULONG CcMapDataWait;
786 ULONG CcMapDataNoWaitMiss;
787 ULONG CcMapDataWaitMiss;
788 ULONG CcPinMappedDataCount;
789 ULONG CcPinReadNoWait;
790 ULONG CcPinReadWait;
791 ULONG CcPinReadNoWaitMiss;
792 ULONG CcPinReadWaitMiss;
793 ULONG CcCopyReadNoWait;
794 ULONG CcCopyReadWait;
795 ULONG CcCopyReadNoWaitMiss;
796 ULONG CcCopyReadWaitMiss;
797 ULONG CcMdlReadNoWait;
798 ULONG CcMdlReadWait;
799 ULONG CcMdlReadNoWaitMiss;
800 ULONG CcMdlReadWaitMiss;
801 ULONG CcReadAheadIos;
802 ULONG CcLazyWriteIos;
803 ULONG CcLazyWritePages;
804 ULONG CcDataFlushes;
805 ULONG CcDataPages;
806 ULONG ContextSwitches;
807 ULONG FirstLevelTbFills;
808 ULONG SecondLevelTbFills;
809 ULONG SystemCalls;
810 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
811
812 // Class 3
813 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
814 {
815 LARGE_INTEGER BootTime;
816 LARGE_INTEGER CurrentTime;
817 LARGE_INTEGER TimeZoneBias;
818 ULONG TimeZoneId;
819 ULONG Reserved;
820 #if (NTDDI_VERSION >= NTDDI_WIN2K)
821 ULONGLONG BootTimeBias;
822 ULONGLONG SleepTimeBias;
823 #endif
824 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
825
826 // Class 4
827 // This class is obsolete, please use KUSER_SHARED_DATA instead
828
829 // Class 5
830 typedef struct _SYSTEM_THREAD_INFORMATION
831 {
832 LARGE_INTEGER KernelTime;
833 LARGE_INTEGER UserTime;
834 LARGE_INTEGER CreateTime;
835 ULONG WaitTime;
836 PVOID StartAddress;
837 CLIENT_ID ClientId;
838 KPRIORITY Priority;
839 LONG BasePriority;
840 ULONG ContextSwitches;
841 ULONG ThreadState;
842 ULONG WaitReason;
843 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
844
845 typedef struct _SYSTEM_PROCESS_INFORMATION
846 {
847 ULONG NextEntryOffset;
848 ULONG NumberOfThreads;
849 LARGE_INTEGER SpareLi1;
850 LARGE_INTEGER SpareLi2;
851 LARGE_INTEGER SpareLi3;
852 LARGE_INTEGER CreateTime;
853 LARGE_INTEGER UserTime;
854 LARGE_INTEGER KernelTime;
855 UNICODE_STRING ImageName;
856 KPRIORITY BasePriority;
857 HANDLE UniqueProcessId;
858 HANDLE InheritedFromUniqueProcessId;
859 ULONG HandleCount;
860 ULONG SessionId;
861 ULONG_PTR PageDirectoryBase;
862
863 //
864 // This part corresponds to VM_COUNTERS_EX.
865 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
866 //
867 SIZE_T PeakVirtualSize;
868 ULONG VirtualSize;
869 SIZE_T PageFaultCount;
870 SIZE_T PeakWorkingSetSize;
871 SIZE_T WorkingSetSize;
872 SIZE_T QuotaPeakPagedPoolUsage;
873 SIZE_T QuotaPagedPoolUsage;
874 SIZE_T QuotaPeakNonPagedPoolUsage;
875 SIZE_T QuotaNonPagedPoolUsage;
876 SIZE_T PagefileUsage;
877 SIZE_T PeakPagefileUsage;
878 SIZE_T PrivatePageCount;
879
880 //
881 // This part corresponds to IO_COUNTERS
882 //
883 LARGE_INTEGER ReadOperationCount;
884 LARGE_INTEGER WriteOperationCount;
885 LARGE_INTEGER OtherOperationCount;
886 LARGE_INTEGER ReadTransferCount;
887 LARGE_INTEGER WriteTransferCount;
888 LARGE_INTEGER OtherTransferCount;
889
890 //SYSTEM_THREAD_INFORMATION TH[1];
891 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
892
893 // Class 6
894 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
895 {
896 ULONG Length;
897 ULONG NumberOfTables;
898 } SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
899
900 // Class 7
901 typedef struct _SYSTEM_DEVICE_INFORMATION
902 {
903 ULONG NumberOfDisks;
904 ULONG NumberOfFloppies;
905 ULONG NumberOfCdRoms;
906 ULONG NumberOfTapes;
907 ULONG NumberOfSerialPorts;
908 ULONG NumberOfParallelPorts;
909 } SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION;
910
911 // Class 8
912 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
913 {
914 LARGE_INTEGER IdleTime;
915 LARGE_INTEGER KernelTime;
916 LARGE_INTEGER UserTime;
917 LARGE_INTEGER DpcTime;
918 LARGE_INTEGER InterruptTime;
919 ULONG InterruptCount;
920 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
921
922 // Class 9
923 typedef struct _SYSTEM_FLAGS_INFORMATION
924 {
925 ULONG Flags;
926 } SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION;
927
928 // Class 10
929 typedef struct _SYSTEM_CALL_TIME_INFORMATION
930 {
931 ULONG Length;
932 ULONG TotalCalls;
933 LARGE_INTEGER TimeOfCalls[1];
934 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
935
936 // Class 11 - See RTL_PROCESS_MODULES
937
938 // Class 12 - See RTL_PROCESS_LOCKS
939
940 // Class 13 - See RTL_PROCESS_BACKTRACES
941
942 // Class 14 - 15
943 typedef struct _SYSTEM_POOL_ENTRY
944 {
945 BOOLEAN Allocated;
946 BOOLEAN Spare0;
947 USHORT AllocatorBackTraceIndex;
948 ULONG Size;
949 union
950 {
951 UCHAR Tag[4];
952 ULONG TagUlong;
953 PVOID ProcessChargedQuota;
954 };
955 } SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY;
956
957 typedef struct _SYSTEM_POOL_INFORMATION
958 {
959 ULONG TotalSize;
960 PVOID FirstEntry;
961 USHORT EntryOverhead;
962 BOOLEAN PoolTagPresent;
963 BOOLEAN Spare0;
964 ULONG NumberOfEntries;
965 SYSTEM_POOL_ENTRY Entries[1];
966 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
967
968 // Class 16
969 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
970 {
971 USHORT UniqueProcessId;
972 USHORT CreatorBackTraceIndex;
973 UCHAR ObjectTypeIndex;
974 UCHAR HandleAttributes;
975 USHORT HandleValue;
976 PVOID Object;
977 ULONG GrantedAccess;
978 } SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
979
980 typedef struct _SYSTEM_HANDLE_INFORMATION
981 {
982 ULONG NumberOfHandles;
983 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1];
984 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
985
986 // Class 17
987 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
988 {
989 ULONG NextEntryOffset;
990 ULONG NumberOfObjects;
991 ULONG NumberOfHandles;
992 ULONG TypeIndex;
993 ULONG InvalidAttributes;
994 GENERIC_MAPPING GenericMapping;
995 ULONG ValidAccessMask;
996 ULONG PoolType;
997 BOOLEAN SecurityRequired;
998 BOOLEAN WaitableObject;
999 UNICODE_STRING TypeName;
1000 } SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION;
1001
1002 typedef struct _SYSTEM_OBJECT_INFORMATION
1003 {
1004 ULONG NextEntryOffset;
1005 PVOID Object;
1006 HANDLE CreatorUniqueProcess;
1007 USHORT CreatorBackTraceIndex;
1008 USHORT Flags;
1009 LONG PointerCount;
1010 LONG HandleCount;
1011 ULONG PagedPoolCharge;
1012 ULONG NonPagedPoolCharge;
1013 HANDLE ExclusiveProcessId;
1014 PVOID SecurityDescriptor;
1015 OBJECT_NAME_INFORMATION NameInfo;
1016 } SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
1017
1018 // Class 18
1019 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1020 {
1021 ULONG NextEntryOffset;
1022 ULONG TotalSize;
1023 ULONG TotalInUse;
1024 ULONG PeakUsage;
1025 UNICODE_STRING PageFileName;
1026 } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
1027
1028 // Class 19
1029 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1030 {
1031 ULONG SegmentNotPresent;
1032 ULONG VdmOpcode0F;
1033 ULONG OpcodeESPrefix;
1034 ULONG OpcodeCSPrefix;
1035 ULONG OpcodeSSPrefix;
1036 ULONG OpcodeDSPrefix;
1037 ULONG OpcodeFSPrefix;
1038 ULONG OpcodeGSPrefix;
1039 ULONG OpcodeOPER32Prefix;
1040 ULONG OpcodeADDR32Prefix;
1041 ULONG OpcodeINSB;
1042 ULONG OpcodeINSW;
1043 ULONG OpcodeOUTSB;
1044 ULONG OpcodeOUTSW;
1045 ULONG OpcodePUSHF;
1046 ULONG OpcodePOPF;
1047 ULONG OpcodeINTnn;
1048 ULONG OpcodeINTO;
1049 ULONG OpcodeIRET;
1050 ULONG OpcodeINBimm;
1051 ULONG OpcodeINWimm;
1052 ULONG OpcodeOUTBimm;
1053 ULONG OpcodeOUTWimm ;
1054 ULONG OpcodeINB;
1055 ULONG OpcodeINW;
1056 ULONG OpcodeOUTB;
1057 ULONG OpcodeOUTW;
1058 ULONG OpcodeLOCKPrefix;
1059 ULONG OpcodeREPNEPrefix;
1060 ULONG OpcodeREPPrefix;
1061 ULONG OpcodeHLT;
1062 ULONG OpcodeCLI;
1063 ULONG OpcodeSTI;
1064 ULONG BopCount;
1065 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
1066
1067 // Class 20 - ULONG VDMBOPINFO
1068
1069 // Class 21
1070 typedef struct _SYSTEM_FILECACHE_INFORMATION
1071 {
1072 ULONG CurrentSize;
1073 ULONG PeakSize;
1074 ULONG PageFaultCount;
1075 ULONG MinimumWorkingSet;
1076 ULONG MaximumWorkingSet;
1077 ULONG CurrentSizeIncludingTransitionInPages;
1078 ULONG PeakSizeIncludingTransitionInPages;
1079 ULONG TransitionRePurposeCount;
1080 ULONG Flags;
1081 } SYSTEM_FILECACHE_INFORMATION, *PSYSTEM_FILECACHE_INFORMATION;
1082
1083 // Class 22
1084 typedef struct _SYSTEM_POOLTAG
1085 {
1086 union
1087 {
1088 UCHAR Tag[4];
1089 ULONG TagUlong;
1090 };
1091 ULONG PagedAllocs;
1092 ULONG PagedFrees;
1093 ULONG PagedUsed;
1094 ULONG NonPagedAllocs;
1095 ULONG NonPagedFrees;
1096 ULONG NonPagedUsed;
1097 } SYSTEM_POOLTAG, *PSYSTEM_POOLTAG;
1098 typedef struct _SYSTEM_POOLTAG_INFORMATION
1099 {
1100 ULONG Count;
1101 SYSTEM_POOLTAG TagInfo[1];
1102 } SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION;
1103
1104 // Class 23
1105 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1106 {
1107 ULONG ContextSwitches;
1108 ULONG DpcCount;
1109 ULONG DpcRate;
1110 ULONG TimeIncrement;
1111 ULONG DpcBypassCount;
1112 ULONG ApcBypassCount;
1113 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1114
1115 // Class 24
1116 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1117 {
1118 ULONG Spare;
1119 ULONG DpcQueueDepth;
1120 ULONG MinimumDpcRate;
1121 ULONG AdjustDpcThreshold;
1122 ULONG IdealDpcRate;
1123 } SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION;
1124
1125 // Class 25
1126 typedef struct _SYSTEM_MEMORY_INFO
1127 {
1128 PUCHAR StringOffset;
1129 USHORT ValidCount;
1130 USHORT TransitionCount;
1131 USHORT ModifiedCount;
1132 USHORT PageTableCount;
1133 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
1134
1135 typedef struct _SYSTEM_MEMORY_INFORMATION
1136 {
1137 ULONG InfoSize;
1138 ULONG StringStart;
1139 SYSTEM_MEMORY_INFO Memory[1];
1140 } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION;
1141
1142 // Class 26
1143 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1144 {
1145 UNICODE_STRING DriverName;
1146 PVOID ImageAddress;
1147 PVOID SectionPointer;
1148 PVOID EntryPoint;
1149 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
1150 ULONG ImageLength;
1151 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
1152
1153 // Class 27
1154 // Not an actually class, simply a PVOID to the ImageAddress
1155
1156 // Class 28
1157 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1158 {
1159 ULONG TimeAdjustment;
1160 ULONG TimeIncrement;
1161 BOOLEAN Enable;
1162 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION;
1163
1164 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1165 {
1166 ULONG TimeAdjustment;
1167 BOOLEAN Enable;
1168 } SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION;
1169
1170 // Class 29 - Same as 25
1171
1172 // FIXME: Class 30
1173
1174 // Class 31
1175 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1176 {
1177 UCHAR TraceEnable;
1178 UCHAR TracePermanent;
1179 UNICODE_STRING TraceProcessName;
1180 UNICODE_STRING TracePoolTags;
1181 } SYSTEM_REF_TRACE_INFORMATION, *PSYSTEM_REF_TRACE_INFORMATION;
1182
1183 // Class 32 - OBSOLETE
1184
1185 // Class 33
1186 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1187 {
1188 ULONG AlignmentFixupCount;
1189 ULONG ExceptionDispatchCount;
1190 ULONG FloatingEmulationCount;
1191 ULONG ByteWordEmulationCount;
1192 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1193
1194 // Class 34
1195 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1196 {
1197 ULONG ValidCrashDump;
1198 } SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION;
1199
1200 // Class 35
1201 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1202 {
1203 BOOLEAN KernelDebuggerEnabled;
1204 BOOLEAN KernelDebuggerNotPresent;
1205 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1206
1207 // Class 36
1208 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1209 {
1210 ULONG ContextSwitches;
1211 ULONG FindAny;
1212 ULONG FindLast;
1213 ULONG FindIdeal;
1214 ULONG IdleAny;
1215 ULONG IdleCurrent;
1216 ULONG IdleLast;
1217 ULONG IdleIdeal;
1218 ULONG PreemptAny;
1219 ULONG PreemptCurrent;
1220 ULONG PreemptLast;
1221 ULONG SwitchToIdle;
1222 } SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION;
1223
1224 // Class 37
1225 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1226 {
1227 ULONG RegistryQuotaAllowed;
1228 ULONG RegistryQuotaUsed;
1229 ULONG PagedPoolSize;
1230 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1231
1232 // Class 38
1233 // Not a structure, simply send the UNICODE_STRING
1234
1235 // Class 39
1236 // Not a structure, simply send a ULONG containing the new separation
1237
1238 // Class 40
1239 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1240 {
1241 ULONG BusCount;
1242 PLUGPLAY_BUS_INSTANCE BusInstance[1];
1243 } SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION;
1244
1245 // Class 41
1246 typedef struct _SYSTEM_DOCK_INFORMATION
1247 {
1248 SYSTEM_DOCK_STATE DockState;
1249 INTERFACE_TYPE DeviceBusType;
1250 ULONG DeviceBusNumber;
1251 ULONG SlotNumber;
1252 } SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION;
1253
1254 // Class 42
1255 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1256 {
1257 BOOLEAN SystemSuspendSupported;
1258 BOOLEAN SystemHibernateSupported;
1259 BOOLEAN ResumeTimerSupportsSuspend;
1260 BOOLEAN ResumeTimerSupportsHibernate;
1261 BOOLEAN LidSupported;
1262 BOOLEAN TurboSettingSupported;
1263 BOOLEAN TurboMode;
1264 BOOLEAN SystemAcOrDc;
1265 BOOLEAN PowerDownDisabled;
1266 LARGE_INTEGER SpindownDrives;
1267 } SYSTEM_POWER_INFORMATION_NATIVE, *PSYSTEM_POWER_INFORMATION_NATIVE;
1268
1269 // Class 43
1270 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1271 {
1272 PNP_VETO_TYPE VetoType;
1273 UNICODE_STRING VetoDriver;
1274 // CHAR Buffer[0];
1275 } SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
1276
1277 // Class 44
1278 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1279
1280 // Class 45
1281 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1282 {
1283 USHORT CurrentDepth;
1284 USHORT MaximumDepth;
1285 ULONG TotalAllocates;
1286 ULONG AllocateMisses;
1287 ULONG TotalFrees;
1288 ULONG FreeMisses;
1289 ULONG Type;
1290 ULONG Tag;
1291 ULONG Size;
1292 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1293
1294 // Class 46
1295 // Not a structure. Only a HANDLE for the SlipEvent;
1296
1297 // Class 47
1298 // Not a structure. Only a ULONG for the SessionId;
1299
1300 // Class 48
1301 // Not a structure. Only a ULONG for the SessionId;
1302
1303 // FIXME: Class 49
1304
1305 // Class 50
1306 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1307
1308 // Class 51
1309 typedef struct _SYSTEM_VERIFIER_INFORMATION
1310 {
1311 ULONG NextEntryOffset;
1312 ULONG Level;
1313 UNICODE_STRING DriverName;
1314 ULONG RaiseIrqls;
1315 ULONG AcquireSpinLocks;
1316 ULONG SynchronizeExecutions;
1317 ULONG AllocationsAttempted;
1318 ULONG AllocationsSucceeded;
1319 ULONG AllocationsSucceededSpecialPool;
1320 ULONG AllocationsWithNoTag;
1321 ULONG TrimRequests;
1322 ULONG Trims;
1323 ULONG AllocationsFailed;
1324 ULONG AllocationsFailedDeliberately;
1325 ULONG Loads;
1326 ULONG Unloads;
1327 ULONG UnTrackedPool;
1328 ULONG CurrentPagedPoolAllocations;
1329 ULONG CurrentNonPagedPoolAllocations;
1330 ULONG PeakPagedPoolAllocations;
1331 ULONG PeakNonPagedPoolAllocations;
1332 ULONG PagedPoolUsageInBytes;
1333 ULONG NonPagedPoolUsageInBytes;
1334 ULONG PeakPagedPoolUsageInBytes;
1335 ULONG PeakNonPagedPoolUsageInBytes;
1336 } SYSTEM_VERIFIER_INFORMATION, *PSYSTEM_VERIFIER_INFORMATION;
1337
1338 // FIXME: Class 52
1339
1340 // Class 53
1341 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1342 {
1343 ULONG SessionId;
1344 ULONG SizeOfBuf;
1345 PVOID Buffer; // Same format as in SystemProcessInformation
1346 } SYSTEM_SESSION_PROCESS_INFORMATION, *PSYSTEM_SESSION_PROCESS_INFORMATION;
1347
1348 // FIXME: Class 54-97
1349
1350 //
1351 // Hotpatch flags
1352 //
1353 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1354 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1355 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1356 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1357 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1358 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1359
1360
1361 // Class 69
1362 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1363 {
1364 ULONG Flags;
1365 ULONG InfoSize;
1366 union
1367 {
1368 struct
1369 {
1370 ULONG Foo;
1371 } CodeInfo;
1372 struct
1373 {
1374 USHORT NameOffset;
1375 USHORT NameLength;
1376 } KernelInfo;
1377 struct
1378 {
1379 USHORT NameOffset;
1380 USHORT NameLength;
1381 USHORT TargetNameOffset;
1382 USHORT TargetNameLength;
1383 UCHAR PatchingFinished;
1384 } UserModeInfo;
1385 struct
1386 {
1387 USHORT NameOffset;
1388 USHORT NameLength;
1389 USHORT TargetNameOffset;
1390 USHORT TargetNameLength;
1391 UCHAR PatchingFinished;
1392 NTSTATUS ReturnCode;
1393 HANDLE TargetProcess;
1394 } InjectionInfo;
1395 struct
1396 {
1397 HANDLE FileHandle1;
1398 PIO_STATUS_BLOCK IoStatusBlock1;
1399 PVOID RenameInformation1;
1400 PVOID RenameInformationLength1;
1401 HANDLE FileHandle2;
1402 PIO_STATUS_BLOCK IoStatusBlock2;
1403 PVOID RenameInformation2;
1404 PVOID RenameInformationLength2;
1405 } RenameInfo;
1406 struct
1407 {
1408 HANDLE ParentDirectory;
1409 HANDLE ObjectHandle1;
1410 HANDLE ObjectHandle2;
1411 } AtomicSwap;
1412 };
1413 } SYSTEM_HOTPATCH_CODE_INFORMATION, *PSYSTEM_HOTPATCH_CODE_INFORMATION;
1414
1415 //
1416 // Class 75
1417 //
1418 #ifdef NTOS_MODE_USER
1419 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1420 {
1421 ULONG ProviderSignature;
1422 BOOLEAN Register;
1423 PFNFTH FirmwareTableHandler;
1424 PVOID DriverObject;
1425 } SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
1426
1427 //
1428 // Class 76
1429 //
1430 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1431 {
1432 ULONG ProviderSignature;
1433 SYSTEM_FIRMWARE_TABLE_ACTION Action;
1434 ULONG TableID;
1435 ULONG TableBufferLength;
1436 UCHAR TableBuffer[1];
1437 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
1438
1439 //
1440 // Class 81
1441 //
1442 typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
1443 {
1444 SIZE_T ZeroPageCount;
1445 SIZE_T FreePageCount;
1446 SIZE_T ModifiedPageCount;
1447 SIZE_T ModifiedNoWritePageCount;
1448 SIZE_T BadPageCount;
1449 SIZE_T PageCountByPriority[8];
1450 SIZE_T RepurposedPagesByPriority[8];
1451 } SYSTEM_MEMORY_LIST_INFORMATION, *PSYSTEM_MEMORY_LIST_INFORMATION;
1452
1453 #endif
1454 #endif