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