- Add internal EX_CALLBACK Object to NDK. (Callback blocks are a new NT 5.2 kernel...
[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(_MSC_VER) && !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
35 //
36 // GCC compatibility
37 //
38 #if defined(__GNUC__)
39 #define __ALIGNED(n) __attribute__((aligned (n)))
40 #elif defined(_MSC_VER)
41 #define __ALIGNED(n) __declspec(align(n))
42 #else
43 #error __ALIGNED not defined for your compiler!
44 #endif
45
46 //
47 // Atom and Language IDs
48 //
49 typedef USHORT LANGID, *PLANGID;
50 typedef USHORT RTL_ATOM, *PRTL_ATOM;
51
52 #ifndef NTOS_MODE_USER
53
54 //
55 // Kernel Exported Object Types
56 //
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;
62
63 //
64 // Exported NT Build Number
65 //
66 extern ULONG NtBuildNumber;
67
68 //
69 // Invalid Handle Value Constant
70 //
71 #define INVALID_HANDLE_VALUE (HANDLE)-1
72
73 #endif
74
75 //
76 // Increments
77 //
78 #define MUTANT_INCREMENT 1
79
80 //
81 // Callback Object Access Mask
82 //
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)
87
88 //
89 // Event Object Access Masks
90 //
91 #ifdef NTOS_MODE_USER
92 #define EVENT_QUERY_STATE 0x0001
93
94 //
95 // Semaphore Object Access Masks
96 //
97 #define SEMAPHORE_QUERY_STATE 0x0001
98 #else
99
100 //
101 // Mutant Object Access Masks
102 //
103 #define MUTANT_QUERY_STATE 0x0001
104 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
105 SYNCHRONIZE | \
106 MUTANT_QUERY_STATE)
107 #endif
108
109 //
110 // Event Pair Access Masks
111 //
112 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
113
114 //
115 // Profile Object Access Masks
116 //
117 #define PROFILE_CONTROL 0x0001
118 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
119
120 //
121 // Maximum Parameters for NtRaiseHardError
122 //
123 #define MAXIMUM_HARDERROR_PARAMETERS 4
124
125 //
126 // Pushlock bits
127 //
128 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
129 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
130 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
131 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
132 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
133 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
134 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
135
136 //
137 // Pushlock Wait Block Flags
138 //
139 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
140 #define EX_PUSH_LOCK_FLAGS_WAIT 2
141
142 //
143 // Resource (ERESOURCE) Flags
144 //
145 #define ResourceHasDisabledPriorityBoost 0x08
146
147 //
148 // Shutdown types for NtShutdownSystem
149 //
150 typedef enum _SHUTDOWN_ACTION
151 {
152 ShutdownNoReboot,
153 ShutdownReboot,
154 ShutdownPowerOff
155 } SHUTDOWN_ACTION;
156
157 //
158 // Responses for NtRaiseHardError
159 //
160 typedef enum _HARDERROR_RESPONSE_OPTION
161 {
162 OptionAbortRetryIgnore,
163 OptionOk,
164 OptionOkCancel,
165 OptionRetryCancel,
166 OptionYesNo,
167 OptionYesNoCancel,
168 OptionShutdownSystem
169 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
170
171 typedef enum _HARDERROR_RESPONSE
172 {
173 ResponseReturnToCaller,
174 ResponseNotHandled,
175 ResponseAbort,
176 ResponseCancel,
177 ResponseIgnore,
178 ResponseNo,
179 ResponseOk,
180 ResponseRetry,
181 ResponseYes
182 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
183
184 //
185 // System Information Classes for NtQuerySystemInformation
186 //
187 typedef enum _SYSTEM_INFORMATION_CLASS
188 {
189 SystemBasicInformation,
190 SystemProcessorInformation,
191 SystemPerformanceInformation,
192 SystemTimeOfDayInformation,
193 SystemPathInformation, /// Obsolete: Use KUSER_SHARED_DATA
194 SystemProcessInformation,
195 SystemCallCountInformation,
196 SystemDeviceInformation,
197 SystemProcessorPerformanceInformation,
198 SystemFlagsInformation,
199 SystemCallTimeInformation,
200 SystemModuleInformation,
201 SystemLocksInformation,
202 SystemStackTraceInformation,
203 SystemPagedPoolInformation,
204 SystemNonPagedPoolInformation,
205 SystemHandleInformation,
206 SystemObjectInformation,
207 SystemPageFileInformation,
208 SystemVdmInstemulInformation,
209 SystemVdmBopInformation,
210 SystemFileCacheInformation,
211 SystemPoolTagInformation,
212 SystemInterruptInformation,
213 SystemDpcBehaviorInformation,
214 SystemFullMemoryInformation,
215 SystemLoadGdiDriverInformation,
216 SystemUnloadGdiDriverInformation,
217 SystemTimeAdjustmentInformation,
218 SystemSummaryMemoryInformation,
219 SystemMirrorMemoryInformation,
220 SystemPerformanceTraceInformation,
221 SystemObsolete0,
222 SystemExceptionInformation,
223 SystemCrashDumpStateInformation,
224 SystemKernelDebuggerInformation,
225 SystemContextSwitchInformation,
226 SystemRegistryQuotaInformation,
227 SystemExtendServiceTableInformation,
228 SystemPrioritySeperation,
229 SystemPlugPlayBusInformation,
230 SystemDockInformation,
231 SystemPowerInformationNative,
232 SystemProcessorSpeedInformation,
233 SystemCurrentTimeZoneInformation,
234 SystemLookasideInformation,
235 SystemTimeSlipNotification,
236 SystemSessionCreate,
237 SystemSessionDetach,
238 SystemSessionInformation,
239 SystemRangeStartInformation,
240 SystemVerifierInformation,
241 SystemAddVerifier,
242 SystemSessionProcessesInformation,
243 SystemLoadGdiDriverInSystemSpaceInformation,
244 SystemNumaProcessorMap,
245 SystemPrefetcherInformation,
246 SystemExtendedProcessInformation,
247 SystemRecommendedSharedDataAlignment,
248 SystemComPlusPackage,
249 SystemNumaAvailableMemory,
250 SystemProcessorPowerInformation,
251 SystemEmulationBasicInformation,
252 SystemEmulationProcessorInformation,
253 SystemExtendedHanfleInformation,
254 SystemLostDelayedWriteInformation,
255 SystemBigPoolInformation,
256 SystemSessionPoolTagInformation,
257 SystemSessionMappedViewInformation,
258 SystemHotpatchInformation,
259 SystemObjectSecurityMode,
260 SystemWatchDogTimerHandler,
261 SystemWatchDogTimerInformation,
262 SystemLogicalProcessorInformation,
263 SystemWo64SharedInformationObosolete,
264 SystemRegisterFirmwareTableInformationHandler,
265 SystemFirmwareTableInformation,
266 SystemModuleInformationEx,
267 SystemVerifierTriageInformation,
268 SystemSuperfetchInformation,
269 SystemMemoryListInformation,
270 SystemFileCacheInformationEx,
271 SystemThreadPriorityClientIdInformation,
272 SystemProcessorIdleCycleTimeInformation,
273 SystemVerifierCancellationInformation,
274 SystemProcessorPowerInformationEx,
275 SystemRefTraceInformation,
276 SystemSpecialPoolInformation,
277 SystemProcessIdInformation,
278 SystemErrorPortInformation,
279 SystemBootEnvironmentInformation,
280 SystemHypervisorInformation,
281 SystemVerifierInformationEx,
282 SystemTimeZoneInformation,
283 SystemImageFileExecutionOptionsInformation,
284 SystemCoverageInformation,
285 SystemPrefetchPathInformation,
286 SystemVerifierFaultsInformation,
287 MaxSystemInfoClass,
288 } SYSTEM_INFORMATION_CLASS;
289
290 //
291 // System Information Classes for NtQueryMutant
292 //
293 typedef enum _MUTANT_INFORMATION_CLASS
294 {
295 MutantBasicInformation,
296 MutantOwnerInformation
297 } MUTANT_INFORMATION_CLASS;
298
299 //
300 // System Information Classes for NtQueryAtom
301 //
302 typedef enum _ATOM_INFORMATION_CLASS
303 {
304 AtomBasicInformation,
305 AtomTableInformation,
306 } ATOM_INFORMATION_CLASS;
307
308 //
309 // System Information Classes for NtQueryTimer
310 //
311 typedef enum _TIMER_INFORMATION_CLASS
312 {
313 TimerBasicInformation
314 } TIMER_INFORMATION_CLASS;
315
316 //
317 // System Information Classes for NtQuerySemaphore
318 //
319 typedef enum _SEMAPHORE_INFORMATION_CLASS
320 {
321 SemaphoreBasicInformation
322 } SEMAPHORE_INFORMATION_CLASS;
323
324 //
325 // System Information Classes for NtQueryEvent
326 //
327 typedef enum _EVENT_INFORMATION_CLASS
328 {
329 EventBasicInformation
330 } EVENT_INFORMATION_CLASS;
331
332 #ifdef NTOS_MODE_USER
333
334 //
335 // Firmware Table Actions for SystemFirmwareTableInformation
336 //
337 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
338 {
339 SystemFirmwareTable_Enumerate = 0,
340 SystemFirmwareTable_Get = 1,
341 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
342
343 //
344 // Firmware Handler Callback
345 //
346 struct _SYSTEM_FIRMWARE_TABLE_INFORMATION;
347 typedef
348 NTSTATUS
349 (__cdecl *PFNFTH)(
350 IN struct _SYSTEM_FIRMWARE_TABLE_INFORMATION *FirmwareTableInformation
351 );
352
353 #else
354
355 //
356 // Compatibility with Windows XP Drivers using ERESOURCE
357 //
358 typedef struct _ERESOURCE_XP
359 {
360 LIST_ENTRY SystemResourcesList;
361 POWNER_ENTRY OwnerTable;
362 SHORT ActiveCount;
363 USHORT Flag;
364 PKSEMAPHORE SharedWaiters;
365 PKEVENT ExclusiveWaiters;
366 OWNER_ENTRY OwnerThreads[2];
367 ULONG ContentionCount;
368 USHORT NumberOfSharedWaiters;
369 USHORT NumberOfExclusiveWaiters;
370 union
371 {
372 PVOID Address;
373 ULONG_PTR CreatorBackTraceIndex;
374 };
375 KSPIN_LOCK SpinLock;
376 } ERESOURCE_XP, *PERESOURCE_XP;
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, *PEX_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 Name;
483 KSPIN_LOCK Lock;
484 LIST_ENTRY RegisteredCallbacks;
485 ULONG AllowMultipleCallbacks;
486 } CALLBACK_OBJECT , *PCALLBACK_OBJECT;
487
488 //
489 // Internal Callback Object
490 //
491 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
492 {
493 EX_RUNDOWN_REF RundownProtect;
494 PVOID Function;
495 PVOID Context;
496 } EX_CALLBACK_ROUTINE_BLOCK, *PEX_CALLBACK_ROUTINE_BLOCK;
497
498 //
499 // Internal Callback Handle
500 //
501 typedef struct _EX_CALLBACK
502 {
503 EX_FAST_REF RoutineBlock;
504 } EX_CALLBACK, *PEX_CALLBACK;
505
506 //
507 // Profile Object
508 //
509 typedef struct _EPROFILE
510 {
511 PEPROCESS Process;
512 PVOID RangeBase;
513 SIZE_T RangeSize;
514 PVOID Buffer;
515 ULONG BufferSize;
516 ULONG BucketSize;
517 PKPROFILE ProfileObject;
518 PVOID LockedBufferAddress;
519 PMDL Mdl;
520 ULONG Segment;
521 KPROFILE_SOURCE ProfileSource;
522 KAFFINITY Affinity;
523 } EPROFILE, *PEPROFILE;
524
525 //
526 // Handle Table Structures
527 //
528 typedef struct _HANDLE_TRACE_DB_ENTRY
529 {
530 CLIENT_ID ClientId;
531 HANDLE Handle;
532 ULONG Type;
533 PVOID StackTrace[16];
534 } HANDLE_TRACE_DB_ENTRY, *PHANDLE_TRACE_DB_ENTRY;
535
536 typedef struct _HANDLE_TRACE_DEBUG_INFO
537 {
538 LONG RefCount;
539 ULONG TableSize;
540 ULONG BitMaskFlags;
541 FAST_MUTEX CloseCompatcionLock;
542 ULONG CurrentStackIndex;
543 HANDLE_TRACE_DB_ENTRY TraceDb[1];
544 } HANDLE_TRACE_DEBUG_INFO, *PHANDLE_TRACE_DEBUG_INFO;
545
546 typedef struct _HANDLE_TABLE_ENTRY_INFO
547 {
548 ULONG AuditMask;
549 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
550
551 typedef struct _HANDLE_TABLE_ENTRY
552 {
553 union
554 {
555 PVOID Object;
556 ULONG_PTR ObAttributes;
557 PHANDLE_TABLE_ENTRY_INFO InfoTable;
558 ULONG_PTR Value;
559 };
560 union
561 {
562 ULONG GrantedAccess;
563 struct
564 {
565 USHORT GrantedAccessIndex;
566 USHORT CreatorBackTraceIndex;
567 };
568 LONG NextFreeTableEntry;
569 };
570 } HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
571
572 //
573 // FIXME
574 //
575 #ifdef _REACTOS_
576 #undef NTDDI_VERSION
577 #define NTDDI_VERSION NTDDI_WIN2K
578 #endif
579
580 typedef struct _HANDLE_TABLE
581 {
582 #if (NTDDI_VERSION >= NTDDI_WINXP)
583 ULONG TableCode;
584 #else
585 PHANDLE_TABLE_ENTRY **Table;
586 #endif
587 PEPROCESS QuotaProcess;
588 PVOID UniqueProcessId;
589 #if (NTDDI_VERSION >= NTDDI_WINXP)
590 EX_PUSH_LOCK HandleLock;
591 LIST_ENTRY HandleTableList;
592 EX_PUSH_LOCK HandleContentionEvent;
593 #else
594 ERESOURCE HandleLock;
595 LIST_ENTRY HandleTableList;
596 KEVENT HandleContentionEvent;
597 #endif
598 PHANDLE_TRACE_DEBUG_INFO DebugInfo;
599 LONG ExtraInfoPages;
600 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
601 union
602 {
603 ULONG Flags;
604 UCHAR StrictFIFO:1;
605 };
606 LONG FirstFreeHandle;
607 PHANDLE_TABLE_ENTRY LastFreeHandleEntry;
608 LONG HandleCount;
609 ULONG NextHandleNeedingPool;
610 #else
611 ULONG FirstFree;
612 ULONG LastFree;
613 ULONG NextHandleNeedingPool;
614 LONG HandleCount;
615 union
616 {
617 ULONG Flags;
618 UCHAR StrictFIFO:1;
619 };
620 #endif
621 } HANDLE_TABLE, *PHANDLE_TABLE;
622
623 #endif
624
625 //
626 // Hard Error LPC Message
627 //
628 typedef struct _HARDERROR_MSG
629 {
630 PORT_MESSAGE h;
631 NTSTATUS Status;
632 LARGE_INTEGER ErrorTime;
633 ULONG ValidResponseOptions;
634 ULONG Response;
635 ULONG NumberOfParameters;
636 ULONG UnicodeStringParameterMask;
637 ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
638 } HARDERROR_MSG, *PHARDERROR_MSG;
639
640 //
641 // Information Structures for NtQueryMutant
642 //
643 typedef struct _MUTANT_BASIC_INFORMATION
644 {
645 LONG CurrentCount;
646 BOOLEAN OwnedByCaller;
647 BOOLEAN AbandonedState;
648 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
649
650 typedef struct _MUTANT_OWNER_INFORMATION
651 {
652 CLIENT_ID ClientId;
653 } MUTANT_OWNER_INFORMATION, *PMUTANT_OWNER_INFORMATION;
654
655 //
656 // Information Structures for NtQueryAtom
657 //
658 typedef struct _ATOM_BASIC_INFORMATION
659 {
660 USHORT UsageCount;
661 USHORT Flags;
662 USHORT NameLength;
663 WCHAR Name[1];
664 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
665
666 typedef struct _ATOM_TABLE_INFORMATION
667 {
668 ULONG NumberOfAtoms;
669 USHORT Atoms[1];
670 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
671
672 //
673 // Information Structures for NtQueryTimer
674 //
675 typedef struct _TIMER_BASIC_INFORMATION
676 {
677 LARGE_INTEGER TimeRemaining;
678 BOOLEAN SignalState;
679 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
680
681 //
682 // Information Structures for NtQuerySemaphore
683 //
684 typedef struct _SEMAPHORE_BASIC_INFORMATION
685 {
686 LONG CurrentCount;
687 LONG MaximumCount;
688 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
689
690 //
691 // Information Structures for NtQueryEvent
692 //
693 typedef struct _EVENT_BASIC_INFORMATION
694 {
695 EVENT_TYPE EventType;
696 LONG EventState;
697 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
698
699 //
700 // Information Structures for NtQuerySystemInformation
701 //
702 typedef struct _SYSTEM_BASIC_INFORMATION
703 {
704 ULONG Reserved;
705 ULONG TimerResolution;
706 ULONG PageSize;
707 ULONG NumberOfPhysicalPages;
708 ULONG LowestPhysicalPageNumber;
709 ULONG HighestPhysicalPageNumber;
710 ULONG AllocationGranularity;
711 ULONG MinimumUserModeAddress;
712 ULONG MaximumUserModeAddress;
713 KAFFINITY ActiveProcessorsAffinityMask;
714 CCHAR NumberOfProcessors;
715 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
716
717 // Class 1
718 typedef struct _SYSTEM_PROCESSOR_INFORMATION
719 {
720 USHORT ProcessorArchitecture;
721 USHORT ProcessorLevel;
722 USHORT ProcessorRevision;
723 USHORT Reserved;
724 ULONG ProcessorFeatureBits;
725 } SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
726
727 // Class 2
728 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
729 {
730 LARGE_INTEGER IdleProcessTime;
731 LARGE_INTEGER IoReadTransferCount;
732 LARGE_INTEGER IoWriteTransferCount;
733 LARGE_INTEGER IoOtherTransferCount;
734 ULONG IoReadOperationCount;
735 ULONG IoWriteOperationCount;
736 ULONG IoOtherOperationCount;
737 ULONG AvailablePages;
738 ULONG CommittedPages;
739 ULONG CommitLimit;
740 ULONG PeakCommitment;
741 ULONG PageFaultCount;
742 ULONG CopyOnWriteCount;
743 ULONG TransitionCount;
744 ULONG CacheTransitionCount;
745 ULONG DemandZeroCount;
746 ULONG PageReadCount;
747 ULONG PageReadIoCount;
748 ULONG CacheReadCount;
749 ULONG CacheIoCount;
750 ULONG DirtyPagesWriteCount;
751 ULONG DirtyWriteIoCount;
752 ULONG MappedPagesWriteCount;
753 ULONG MappedWriteIoCount;
754 ULONG PagedPoolPages;
755 ULONG NonPagedPoolPages;
756 ULONG PagedPoolAllocs;
757 ULONG PagedPoolFrees;
758 ULONG NonPagedPoolAllocs;
759 ULONG NonPagedPoolFrees;
760 ULONG FreeSystemPtes;
761 ULONG ResidentSystemCodePage;
762 ULONG TotalSystemDriverPages;
763 ULONG TotalSystemCodePages;
764 ULONG NonPagedPoolLookasideHits;
765 ULONG PagedPoolLookasideHits;
766 ULONG Spare3Count;
767 ULONG ResidentSystemCachePage;
768 ULONG ResidentPagedPoolPage;
769 ULONG ResidentSystemDriverPage;
770 ULONG CcFastReadNoWait;
771 ULONG CcFastReadWait;
772 ULONG CcFastReadResourceMiss;
773 ULONG CcFastReadNotPossible;
774 ULONG CcFastMdlReadNoWait;
775 ULONG CcFastMdlReadWait;
776 ULONG CcFastMdlReadResourceMiss;
777 ULONG CcFastMdlReadNotPossible;
778 ULONG CcMapDataNoWait;
779 ULONG CcMapDataWait;
780 ULONG CcMapDataNoWaitMiss;
781 ULONG CcMapDataWaitMiss;
782 ULONG CcPinMappedDataCount;
783 ULONG CcPinReadNoWait;
784 ULONG CcPinReadWait;
785 ULONG CcPinReadNoWaitMiss;
786 ULONG CcPinReadWaitMiss;
787 ULONG CcCopyReadNoWait;
788 ULONG CcCopyReadWait;
789 ULONG CcCopyReadNoWaitMiss;
790 ULONG CcCopyReadWaitMiss;
791 ULONG CcMdlReadNoWait;
792 ULONG CcMdlReadWait;
793 ULONG CcMdlReadNoWaitMiss;
794 ULONG CcMdlReadWaitMiss;
795 ULONG CcReadAheadIos;
796 ULONG CcLazyWriteIos;
797 ULONG CcLazyWritePages;
798 ULONG CcDataFlushes;
799 ULONG CcDataPages;
800 ULONG ContextSwitches;
801 ULONG FirstLevelTbFills;
802 ULONG SecondLevelTbFills;
803 ULONG SystemCalls;
804 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
805
806 // Class 3
807 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
808 {
809 LARGE_INTEGER BootTime;
810 LARGE_INTEGER CurrentTime;
811 LARGE_INTEGER TimeZoneBias;
812 ULONG TimeZoneId;
813 ULONG Reserved;
814 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
815
816 // Class 4
817 // This class is obsolete, please use KUSER_SHARED_DATA instead
818
819 // Class 5
820 typedef struct _SYSTEM_THREAD_INFORMATION
821 {
822 LARGE_INTEGER KernelTime;
823 LARGE_INTEGER UserTime;
824 LARGE_INTEGER CreateTime;
825 ULONG WaitTime;
826 PVOID StartAddress;
827 CLIENT_ID ClientId;
828 KPRIORITY Priority;
829 LONG BasePriority;
830 ULONG ContextSwitches;
831 ULONG ThreadState;
832 ULONG WaitReason;
833 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
834
835 typedef struct _SYSTEM_PROCESS_INFORMATION
836 {
837 ULONG NextEntryOffset;
838 ULONG NumberOfThreads;
839 LARGE_INTEGER SpareLi1;
840 LARGE_INTEGER SpareLi2;
841 LARGE_INTEGER SpareLi3;
842 LARGE_INTEGER CreateTime;
843 LARGE_INTEGER UserTime;
844 LARGE_INTEGER KernelTime;
845 UNICODE_STRING ImageName;
846 KPRIORITY BasePriority;
847 HANDLE UniqueProcessId;
848 HANDLE InheritedFromUniqueProcessId;
849 ULONG HandleCount;
850 ULONG SessionId;
851 ULONG UniqueProcessKey;
852
853 //
854 // This part corresponds to VM_COUNTERS_EX.
855 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
856 //
857 ULONG PeakVirtualSize;
858 ULONG VirtualSize;
859 ULONG PageFaultCount;
860 ULONG PeakWorkingSetSize;
861 ULONG WorkingSetSize;
862 ULONG QuotaPeakPagedPoolUsage;
863 ULONG QuotaPagedPoolUsage;
864 ULONG QuotaPeakNonPagedPoolUsage;
865 ULONG QuotaNonPagedPoolUsage;
866 ULONG PagefileUsage;
867 ULONG PeakPagefileUsage;
868 ULONG PrivatePageCount;
869
870 //
871 // This part corresponds to IO_COUNTERS
872 //
873 LARGE_INTEGER ReadOperationCount;
874 LARGE_INTEGER WriteOperationCount;
875 LARGE_INTEGER OtherOperationCount;
876 LARGE_INTEGER ReadTransferCount;
877 LARGE_INTEGER WriteTransferCount;
878 LARGE_INTEGER OtherTransferCount;
879
880 //SYSTEM_THREAD_INFORMATION TH[1];
881 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
882
883 // Class 6
884 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
885 {
886 ULONG Length;
887 ULONG NumberOfTables;
888 } SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
889
890 // Class 7
891 typedef struct _SYSTEM_DEVICE_INFORMATION
892 {
893 ULONG NumberOfDisks;
894 ULONG NumberOfFloppies;
895 ULONG NumberOfCdRoms;
896 ULONG NumberOfTapes;
897 ULONG NumberOfSerialPorts;
898 ULONG NumberOfParallelPorts;
899 } SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION;
900
901 // Class 8
902 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
903 {
904 LARGE_INTEGER IdleTime;
905 LARGE_INTEGER KernelTime;
906 LARGE_INTEGER UserTime;
907 LARGE_INTEGER DpcTime;
908 LARGE_INTEGER InterruptTime;
909 ULONG InterruptCount;
910 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
911
912 // Class 9
913 typedef struct _SYSTEM_FLAGS_INFORMATION
914 {
915 ULONG Flags;
916 } SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION;
917
918 // Class 10
919 typedef struct _SYSTEM_CALL_TIME_INFORMATION
920 {
921 ULONG Length;
922 ULONG TotalCalls;
923 LARGE_INTEGER TimeOfCalls[1];
924 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
925
926 // Class 11 - See RTL_PROCESS_MODULES
927
928 // Class 12 - See RTL_PROCESS_LOCKS
929
930 // Class 13 - See RTL_PROCESS_BACKTRACES
931
932 // Class 14 - 15
933 typedef struct _SYSTEM_POOL_ENTRY
934 {
935 BOOLEAN Allocated;
936 BOOLEAN Spare0;
937 USHORT AllocatorBackTraceIndex;
938 ULONG Size;
939 union
940 {
941 UCHAR Tag[4];
942 ULONG TagUlong;
943 PVOID ProcessChargedQuota;
944 };
945 } SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY;
946
947 typedef struct _SYSTEM_POOL_INFORMATION
948 {
949 ULONG TotalSize;
950 PVOID FirstEntry;
951 USHORT EntryOverhead;
952 BOOLEAN PoolTagPresent;
953 BOOLEAN Spare0;
954 ULONG NumberOfEntries;
955 SYSTEM_POOL_ENTRY Entries[1];
956 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
957
958 // Class 16
959 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
960 {
961 USHORT UniqueProcessId;
962 USHORT CreatorBackTraceIndex;
963 UCHAR ObjectTypeIndex;
964 UCHAR HandleAttributes;
965 USHORT HandleValue;
966 PVOID Object;
967 ULONG GrantedAccess;
968 } SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
969
970 typedef struct _SYSTEM_HANDLE_INFORMATION
971 {
972 ULONG NumberOfHandles;
973 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1];
974 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
975
976 // Class 17
977 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
978 {
979 ULONG NextEntryOffset;
980 ULONG NumberOfObjects;
981 ULONG NumberOfHandles;
982 ULONG TypeIndex;
983 ULONG InvalidAttributes;
984 GENERIC_MAPPING GenericMapping;
985 ULONG ValidAccessMask;
986 ULONG PoolType;
987 BOOLEAN SecurityRequired;
988 BOOLEAN WaitableObject;
989 UNICODE_STRING TypeName;
990 } SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION;
991
992 typedef struct _SYSTEM_OBJECT_INFORMATION
993 {
994 ULONG NextEntryOffset;
995 PVOID Object;
996 HANDLE CreatorUniqueProcess;
997 USHORT CreatorBackTraceIndex;
998 USHORT Flags;
999 LONG PointerCount;
1000 LONG HandleCount;
1001 ULONG PagedPoolCharge;
1002 ULONG NonPagedPoolCharge;
1003 HANDLE ExclusiveProcessId;
1004 PVOID SecurityDescriptor;
1005 OBJECT_NAME_INFORMATION NameInfo;
1006 } SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
1007
1008 // Class 18
1009 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1010 {
1011 ULONG NextEntryOffset;
1012 ULONG TotalSize;
1013 ULONG TotalInUse;
1014 ULONG PeakUsage;
1015 UNICODE_STRING PageFileName;
1016 } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
1017
1018 // Class 19
1019 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1020 {
1021 ULONG SegmentNotPresent;
1022 ULONG VdmOpcode0F;
1023 ULONG OpcodeESPrefix;
1024 ULONG OpcodeCSPrefix;
1025 ULONG OpcodeSSPrefix;
1026 ULONG OpcodeDSPrefix;
1027 ULONG OpcodeFSPrefix;
1028 ULONG OpcodeGSPrefix;
1029 ULONG OpcodeOPER32Prefix;
1030 ULONG OpcodeADDR32Prefix;
1031 ULONG OpcodeINSB;
1032 ULONG OpcodeINSW;
1033 ULONG OpcodeOUTSB;
1034 ULONG OpcodeOUTSW;
1035 ULONG OpcodePUSHF;
1036 ULONG OpcodePOPF;
1037 ULONG OpcodeINTnn;
1038 ULONG OpcodeINTO;
1039 ULONG OpcodeIRET;
1040 ULONG OpcodeINBimm;
1041 ULONG OpcodeINWimm;
1042 ULONG OpcodeOUTBimm;
1043 ULONG OpcodeOUTWimm ;
1044 ULONG OpcodeINB;
1045 ULONG OpcodeINW;
1046 ULONG OpcodeOUTB;
1047 ULONG OpcodeOUTW;
1048 ULONG OpcodeLOCKPrefix;
1049 ULONG OpcodeREPNEPrefix;
1050 ULONG OpcodeREPPrefix;
1051 ULONG OpcodeHLT;
1052 ULONG OpcodeCLI;
1053 ULONG OpcodeSTI;
1054 ULONG BopCount;
1055 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
1056
1057 // Class 20 - ULONG VDMBOPINFO
1058
1059 // Class 21
1060 typedef struct _SYSTEM_FILECACHE_INFORMATION
1061 {
1062 ULONG CurrentSize;
1063 ULONG PeakSize;
1064 ULONG PageFaultCount;
1065 ULONG MinimumWorkingSet;
1066 ULONG MaximumWorkingSet;
1067 ULONG CurrentSizeIncludingTransitionInPages;
1068 ULONG PeakSizeIncludingTransitionInPages;
1069 ULONG TransitionRePurposeCount;
1070 ULONG Flags;
1071 } SYSTEM_FILECACHE_INFORMATION, *PSYSTEM_FILECACHE_INFORMATION;
1072
1073 // Class 22
1074 typedef struct _SYSTEM_POOLTAG
1075 {
1076 union
1077 {
1078 UCHAR Tag[4];
1079 ULONG TagUlong;
1080 };
1081 ULONG PagedAllocs;
1082 ULONG PagedFrees;
1083 ULONG PagedUsed;
1084 ULONG NonPagedAllocs;
1085 ULONG NonPagedFrees;
1086 ULONG NonPagedUsed;
1087 } SYSTEM_POOLTAG, *PSYSTEM_POOLTAG;
1088 typedef struct _SYSTEM_POOLTAG_INFORMATION
1089 {
1090 ULONG Count;
1091 SYSTEM_POOLTAG TagInfo[1];
1092 } SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION;
1093
1094 // Class 23
1095 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1096 {
1097 ULONG ContextSwitches;
1098 ULONG DpcCount;
1099 ULONG DpcRate;
1100 ULONG TimeIncrement;
1101 ULONG DpcBypassCount;
1102 ULONG ApcBypassCount;
1103 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1104
1105 // Class 24
1106 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1107 {
1108 ULONG Spare;
1109 ULONG DpcQueueDepth;
1110 ULONG MinimumDpcRate;
1111 ULONG AdjustDpcThreshold;
1112 ULONG IdealDpcRate;
1113 } SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION;
1114
1115 // Class 25
1116 typedef struct _SYSTEM_MEMORY_INFO
1117 {
1118 PUCHAR StringOffset;
1119 USHORT ValidCount;
1120 USHORT TransitionCount;
1121 USHORT ModifiedCount;
1122 USHORT PageTableCount;
1123 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
1124
1125 typedef struct _SYSTEM_MEMORY_INFORMATION
1126 {
1127 ULONG InfoSize;
1128 ULONG StringStart;
1129 SYSTEM_MEMORY_INFO Memory[1];
1130 } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION;
1131
1132 // Class 26
1133 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1134 {
1135 UNICODE_STRING DriverName;
1136 PVOID ImageAddress;
1137 PVOID SectionPointer;
1138 PVOID EntryPoint;
1139 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
1140 ULONG ImageLength;
1141 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
1142
1143 // Class 27
1144 // Not an actually class, simply a PVOID to the ImageAddress
1145
1146 // Class 28
1147 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1148 {
1149 ULONG TimeAdjustment;
1150 ULONG TimeIncrement;
1151 BOOLEAN Enable;
1152 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION;
1153
1154 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1155 {
1156 ULONG TimeAdjustment;
1157 BOOLEAN Enable;
1158 } SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION;
1159
1160 // Class 29 - Same as 25
1161
1162 // FIXME: Class 30
1163
1164 // Class 31
1165 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1166 {
1167 UCHAR TraceEnable;
1168 UCHAR TracePermanent;
1169 UNICODE_STRING TraceProcessName;
1170 UNICODE_STRING TracePoolTags;
1171 } SYSTEM_REF_TRACE_INFORMATION, *PSYSTEM_REF_TRACE_INFORMATION;
1172
1173 // Class 32 - OBSOLETE
1174
1175 // Class 33
1176 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1177 {
1178 ULONG AlignmentFixupCount;
1179 ULONG ExceptionDispatchCount;
1180 ULONG FloatingEmulationCount;
1181 ULONG ByteWordEmulationCount;
1182 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1183
1184 // Class 34
1185 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1186 {
1187 ULONG ValidCrashDump;
1188 } SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION;
1189
1190 // Class 35
1191 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1192 {
1193 BOOLEAN KernelDebuggerEnabled;
1194 BOOLEAN KernelDebuggerNotPresent;
1195 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1196
1197 // Class 36
1198 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1199 {
1200 ULONG ContextSwitches;
1201 ULONG FindAny;
1202 ULONG FindLast;
1203 ULONG FindIdeal;
1204 ULONG IdleAny;
1205 ULONG IdleCurrent;
1206 ULONG IdleLast;
1207 ULONG IdleIdeal;
1208 ULONG PreemptAny;
1209 ULONG PreemptCurrent;
1210 ULONG PreemptLast;
1211 ULONG SwitchToIdle;
1212 } SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION;
1213
1214 // Class 37
1215 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1216 {
1217 ULONG RegistryQuotaAllowed;
1218 ULONG RegistryQuotaUsed;
1219 ULONG PagedPoolSize;
1220 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1221
1222 // Class 38
1223 // Not a structure, simply send the UNICODE_STRING
1224
1225 // Class 39
1226 // Not a structure, simply send a ULONG containing the new separation
1227
1228 // Class 40
1229 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1230 {
1231 ULONG BusCount;
1232 PLUGPLAY_BUS_INSTANCE BusInstance[1];
1233 } SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION;
1234
1235 // Class 41
1236 typedef struct _SYSTEM_DOCK_INFORMATION
1237 {
1238 SYSTEM_DOCK_STATE DockState;
1239 INTERFACE_TYPE DeviceBusType;
1240 ULONG DeviceBusNumber;
1241 ULONG SlotNumber;
1242 } SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION;
1243
1244 // Class 42
1245 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1246 {
1247 BOOLEAN SystemSuspendSupported;
1248 BOOLEAN SystemHibernateSupported;
1249 BOOLEAN ResumeTimerSupportsSuspend;
1250 BOOLEAN ResumeTimerSupportsHibernate;
1251 BOOLEAN LidSupported;
1252 BOOLEAN TurboSettingSupported;
1253 BOOLEAN TurboMode;
1254 BOOLEAN SystemAcOrDc;
1255 BOOLEAN PowerDownDisabled;
1256 LARGE_INTEGER SpindownDrives;
1257 } SYSTEM_POWER_INFORMATION_NATIVE, *PSYSTEM_POWER_INFORMATION_NATIVE;
1258
1259 // Class 43
1260 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1261 {
1262 PNP_VETO_TYPE VetoType;
1263 UNICODE_STRING VetoDriver;
1264 // CHAR Buffer[0];
1265 } SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
1266
1267 // Class 44
1268 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1269
1270 // Class 45
1271 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1272 {
1273 USHORT CurrentDepth;
1274 USHORT MaximumDepth;
1275 ULONG TotalAllocates;
1276 ULONG AllocateMisses;
1277 ULONG TotalFrees;
1278 ULONG FreeMisses;
1279 ULONG Type;
1280 ULONG Tag;
1281 ULONG Size;
1282 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1283
1284 // Class 46
1285 // Not a structure. Only a HANDLE for the SlipEvent;
1286
1287 // Class 47
1288 // Not a structure. Only a ULONG for the SessionId;
1289
1290 // Class 48
1291 // Not a structure. Only a ULONG for the SessionId;
1292
1293 // FIXME: Class 49
1294
1295 // Class 50
1296 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1297
1298 // Class 51
1299 typedef struct _SYSTEM_VERIFIER_INFORMATION
1300 {
1301 ULONG NextEntryOffset;
1302 ULONG Level;
1303 UNICODE_STRING DriverName;
1304 ULONG RaiseIrqls;
1305 ULONG AcquireSpinLocks;
1306 ULONG SynchronizeExecutions;
1307 ULONG AllocationsAttempted;
1308 ULONG AllocationsSucceeded;
1309 ULONG AllocationsSucceededSpecialPool;
1310 ULONG AllocationsWithNoTag;
1311 ULONG TrimRequests;
1312 ULONG Trims;
1313 ULONG AllocationsFailed;
1314 ULONG AllocationsFailedDeliberately;
1315 ULONG Loads;
1316 ULONG Unloads;
1317 ULONG UnTrackedPool;
1318 ULONG CurrentPagedPoolAllocations;
1319 ULONG CurrentNonPagedPoolAllocations;
1320 ULONG PeakPagedPoolAllocations;
1321 ULONG PeakNonPagedPoolAllocations;
1322 ULONG PagedPoolUsageInBytes;
1323 ULONG NonPagedPoolUsageInBytes;
1324 ULONG PeakPagedPoolUsageInBytes;
1325 ULONG PeakNonPagedPoolUsageInBytes;
1326 } SYSTEM_VERIFIER_INFORMATION, *PSYSTEM_VERIFIER_INFORMATION;
1327
1328 // FIXME: Class 52
1329
1330 // Class 53
1331 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1332 {
1333 ULONG SessionId;
1334 ULONG SizeOfBuf;
1335 PVOID Buffer; // Same format as in SystemProcessInformation
1336 } SYSTEM_SESSION_PROCESS_INFORMATION, *PSYSTEM_SESSION_PROCESS_INFORMATION;
1337
1338 // FIXME: Class 54-97
1339
1340 //
1341 // Hotpatch flags
1342 //
1343 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1344 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1345 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1346 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1347 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1348 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1349
1350
1351 // Class 69
1352 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1353 {
1354 ULONG Flags;
1355 ULONG InfoSize;
1356 union
1357 {
1358 struct
1359 {
1360 ULONG Foo;
1361 } CodeInfo;
1362 struct
1363 {
1364 USHORT NameOffset;
1365 USHORT NameLength;
1366 } KernelInfo;
1367 struct
1368 {
1369 USHORT NameOffset;
1370 USHORT NameLength;
1371 USHORT TargetNameOffset;
1372 USHORT TargetNameLength;
1373 UCHAR PatchingFinished;
1374 } UserModeInfo;
1375 struct
1376 {
1377 USHORT NameOffset;
1378 USHORT NameLength;
1379 USHORT TargetNameOffset;
1380 USHORT TargetNameLength;
1381 UCHAR PatchingFinished;
1382 NTSTATUS ReturnCode;
1383 HANDLE TargetProcess;
1384 } InjectionInfo;
1385 struct
1386 {
1387 HANDLE FileHandle1;
1388 PIO_STATUS_BLOCK IoStatusBlock1;
1389 PVOID RenameInformation1;
1390 PVOID RenameInformationLength1;
1391 HANDLE FileHandle2;
1392 PIO_STATUS_BLOCK IoStatusBlock2;
1393 PVOID RenameInformation2;
1394 PVOID RenameInformationLength2;
1395 } RenameInfo;
1396 struct
1397 {
1398 HANDLE ParentDirectory;
1399 HANDLE ObjectHandle1;
1400 HANDLE ObjectHandle2;
1401 } AtomicSwap;
1402 };
1403 } SYSTEM_HOTPATCH_CODE_INFORMATION, *PSYSTEM_HOTPATCH_CODE_INFORMATION;
1404
1405 //
1406 // Class 75
1407 //
1408 #ifdef NTOS_MODE_USER
1409 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1410 {
1411 ULONG ProviderSignature;
1412 BOOLEAN Register;
1413 PFNFTH FirmwareTableHandler;
1414 PVOID DriverObject;
1415 } SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
1416
1417 //
1418 // Class 76
1419 //
1420 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1421 {
1422 ULONG ProviderSignature;
1423 SYSTEM_FIRMWARE_TABLE_ACTION Action;
1424 ULONG TableID;
1425 ULONG TableBufferLength;
1426 UCHAR TableBuffer[1];
1427 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
1428 #endif
1429 #endif