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