- Fix HANDLE_TABLE definition.
[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 // Compatibility with Windows XP Drivers using ERESOURCE
366 //
367 typedef struct _ERESOURCE_XP
368 {
369 LIST_ENTRY SystemResourcesList;
370 POWNER_ENTRY OwnerTable;
371 SHORT ActiveCount;
372 USHORT Flag;
373 PKSEMAPHORE SharedWaiters;
374 PKEVENT ExclusiveWaiters;
375 OWNER_ENTRY OwnerThreads[2];
376 ULONG ContentionCount;
377 USHORT NumberOfSharedWaiters;
378 USHORT NumberOfExclusiveWaiters;
379 union
380 {
381 PVOID Address;
382 ULONG_PTR CreatorBackTraceIndex;
383 };
384 KSPIN_LOCK SpinLock;
385 } ERESOURCE_XP, *PERESOURCE_XP;
386
387 //
388 // Executive Work Queue Structures
389 //
390 typedef struct _EX_QUEUE_WORKER_INFO
391 {
392 ULONG QueueDisabled:1;
393 ULONG MakeThreadsAsNecessary:1;
394 ULONG WaitMode:1;
395 ULONG WorkerCount:29;
396 } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;
397
398 typedef struct _EX_WORK_QUEUE
399 {
400 KQUEUE WorkerQueue;
401 LONG DynamicThreadCount;
402 ULONG WorkItemsProcessed;
403 ULONG WorkItemsProcessedLastPass;
404 ULONG QueueDepthLastPass;
405 EX_QUEUE_WORKER_INFO Info;
406 } EX_WORK_QUEUE, *PEX_WORK_QUEUE;
407
408 //
409 // Executive Fast Reference Structure
410 //
411 typedef struct _EX_FAST_REF
412 {
413 union
414 {
415 PVOID Object;
416 ULONG_PTR RefCnt:3;
417 ULONG_PTR Value;
418 };
419 } EX_FAST_REF, *PEX_FAST_REF;
420
421 //
422 // Executive Cache-Aware Rundown Reference Descriptor
423 //
424 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
425 {
426 PEX_RUNDOWN_REF RunRefs;
427 PVOID PoolToFree;
428 ULONG RunRefSize;
429 ULONG Number;
430 } EX_RUNDOWN_REF_CACHE_AWARE, *PEX_RUNDOWN_REF_CACHE_AWARE;
431
432 //
433 // Executive Rundown Wait Block
434 //
435 typedef struct _EX_RUNDOWN_WAIT_BLOCK
436 {
437 ULONG_PTR Count;
438 KEVENT WakeEvent;
439 } EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
440
441 //
442 // Executive Pushlock
443 //
444 #undef EX_PUSH_LOCK
445 #undef PEX_PUSH_LOCK
446 typedef struct _EX_PUSH_LOCK
447 {
448 union
449 {
450 struct
451 {
452 ULONG_PTR Locked:1;
453 ULONG_PTR Waiting:1;
454 ULONG_PTR Waking:1;
455 ULONG_PTR MultipleShared:1;
456 ULONG_PTR Shared:sizeof (ULONG_PTR) * 8 - 4;
457 };
458 ULONG_PTR Value;
459 PVOID Ptr;
460 };
461 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
462
463 //
464 // Executive Pushlock Wait Block
465 //
466 typedef __ALIGNED(16) struct _EX_PUSH_LOCK_WAIT_BLOCK
467 {
468 union
469 {
470 KGATE WakeGate;
471 KEVENT WakeEvent;
472 };
473 struct _EX_PUSH_LOCK_WAIT_BLOCK *Next;
474 struct _EX_PUSH_LOCK_WAIT_BLOCK *Last;
475 struct _EX_PUSH_LOCK_WAIT_BLOCK *Previous;
476 LONG ShareCount;
477 LONG Flags;
478 #if DBG
479 BOOLEAN Signaled;
480 EX_PUSH_LOCK NewValue;
481 EX_PUSH_LOCK OldValue;
482 PEX_PUSH_LOCK PushLock;
483 #endif
484 } EX_PUSH_LOCK_WAIT_BLOCK, *PEX_PUSH_LOCK_WAIT_BLOCK;
485
486 //
487 // Callback Object
488 //
489 typedef struct _CALLBACK_OBJECT
490 {
491 ULONG Signature;
492 KSPIN_LOCK Lock;
493 LIST_ENTRY RegisteredCallbacks;
494 BOOLEAN AllowMultipleCallbacks;
495 UCHAR reserved[3];
496 } CALLBACK_OBJECT, *PCALLBACK_OBJECT;
497
498 //
499 // Callback Handle
500 //
501 typedef struct _CALLBACK_REGISTRATION
502 {
503 LIST_ENTRY Link;
504 PCALLBACK_OBJECT CallbackObject;
505 PCALLBACK_FUNCTION CallbackFunction;
506 PVOID CallbackContext;
507 ULONG Busy;
508 BOOLEAN UnregisterWaiting;
509 } CALLBACK_REGISTRATION, *PCALLBACK_REGISTRATION;
510
511 //
512 // Internal Callback Object
513 //
514 typedef struct _EX_CALLBACK_ROUTINE_BLOCK
515 {
516 EX_RUNDOWN_REF RundownProtect;
517 PEX_CALLBACK_FUNCTION Function;
518 PVOID Context;
519 } EX_CALLBACK_ROUTINE_BLOCK, *PEX_CALLBACK_ROUTINE_BLOCK;
520
521 //
522 // Internal Callback Handle
523 //
524 typedef struct _EX_CALLBACK
525 {
526 EX_FAST_REF RoutineBlock;
527 } EX_CALLBACK, *PEX_CALLBACK;
528
529 //
530 // Profile Object
531 //
532 typedef struct _EPROFILE
533 {
534 PEPROCESS Process;
535 PVOID RangeBase;
536 SIZE_T RangeSize;
537 PVOID Buffer;
538 ULONG BufferSize;
539 ULONG BucketSize;
540 PKPROFILE ProfileObject;
541 PVOID LockedBufferAddress;
542 PMDL Mdl;
543 ULONG Segment;
544 KPROFILE_SOURCE ProfileSource;
545 KAFFINITY Affinity;
546 } EPROFILE, *PEPROFILE;
547
548 //
549 // Handle Table Structures
550 //
551 typedef struct _HANDLE_TRACE_DB_ENTRY
552 {
553 CLIENT_ID ClientId;
554 HANDLE Handle;
555 ULONG Type;
556 PVOID StackTrace[16];
557 } HANDLE_TRACE_DB_ENTRY, *PHANDLE_TRACE_DB_ENTRY;
558
559 typedef struct _HANDLE_TRACE_DEBUG_INFO
560 {
561 LONG RefCount;
562 ULONG TableSize;
563 ULONG BitMaskFlags;
564 FAST_MUTEX CloseCompatcionLock;
565 ULONG CurrentStackIndex;
566 HANDLE_TRACE_DB_ENTRY TraceDb[1];
567 } HANDLE_TRACE_DEBUG_INFO, *PHANDLE_TRACE_DEBUG_INFO;
568
569 typedef struct _HANDLE_TABLE_ENTRY_INFO
570 {
571 ULONG AuditMask;
572 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
573
574 typedef struct _HANDLE_TABLE_ENTRY
575 {
576 union
577 {
578 PVOID Object;
579 ULONG_PTR ObAttributes;
580 PHANDLE_TABLE_ENTRY_INFO InfoTable;
581 ULONG_PTR Value;
582 };
583 union
584 {
585 ULONG GrantedAccess;
586 struct
587 {
588 USHORT GrantedAccessIndex;
589 USHORT CreatorBackTraceIndex;
590 };
591 LONG NextFreeTableEntry;
592 };
593 } HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
594
595 typedef struct _HANDLE_TABLE
596 {
597 #if (NTDDI_VERSION >= NTDDI_WINXP)
598 ULONG TableCode;
599 #else
600 PHANDLE_TABLE_ENTRY **Table;
601 #endif
602 PEPROCESS QuotaProcess;
603 PVOID UniqueProcessId;
604 #if (NTDDI_VERSION >= NTDDI_WINXP)
605 EX_PUSH_LOCK HandleTableLock[4];
606 LIST_ENTRY HandleTableList;
607 EX_PUSH_LOCK HandleContentionEvent;
608 #else
609 ERESOURCE HandleLock;
610 LIST_ENTRY HandleTableList;
611 KEVENT HandleContentionEvent;
612 #endif
613 PHANDLE_TRACE_DEBUG_INFO DebugInfo;
614 LONG ExtraInfoPages;
615 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
616 union
617 {
618 ULONG Flags;
619 UCHAR StrictFIFO:1;
620 };
621 LONG FirstFreeHandle;
622 PHANDLE_TABLE_ENTRY LastFreeHandleEntry;
623 LONG HandleCount;
624 ULONG NextHandleNeedingPool;
625 #else
626 ULONG FirstFree;
627 ULONG LastFree;
628 ULONG NextHandleNeedingPool;
629 LONG HandleCount;
630 union
631 {
632 ULONG Flags;
633 UCHAR StrictFIFO:1;
634 };
635 #endif
636 } HANDLE_TABLE, *PHANDLE_TABLE;
637
638 #endif
639
640 //
641 // Hard Error LPC Message
642 //
643 typedef struct _HARDERROR_MSG
644 {
645 PORT_MESSAGE h;
646 NTSTATUS Status;
647 LARGE_INTEGER ErrorTime;
648 ULONG ValidResponseOptions;
649 ULONG Response;
650 ULONG NumberOfParameters;
651 ULONG UnicodeStringParameterMask;
652 ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
653 } HARDERROR_MSG, *PHARDERROR_MSG;
654
655 //
656 // Information Structures for NtQueryMutant
657 //
658 typedef struct _MUTANT_BASIC_INFORMATION
659 {
660 LONG CurrentCount;
661 BOOLEAN OwnedByCaller;
662 BOOLEAN AbandonedState;
663 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
664
665 typedef struct _MUTANT_OWNER_INFORMATION
666 {
667 CLIENT_ID ClientId;
668 } MUTANT_OWNER_INFORMATION, *PMUTANT_OWNER_INFORMATION;
669
670 //
671 // Information Structures for NtQueryAtom
672 //
673 typedef struct _ATOM_BASIC_INFORMATION
674 {
675 USHORT UsageCount;
676 USHORT Flags;
677 USHORT NameLength;
678 WCHAR Name[1];
679 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
680
681 typedef struct _ATOM_TABLE_INFORMATION
682 {
683 ULONG NumberOfAtoms;
684 USHORT Atoms[1];
685 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
686
687 //
688 // Information Structures for NtQueryTimer
689 //
690 typedef struct _TIMER_BASIC_INFORMATION
691 {
692 LARGE_INTEGER TimeRemaining;
693 BOOLEAN SignalState;
694 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
695
696 //
697 // Information Structures for NtQuerySemaphore
698 //
699 typedef struct _SEMAPHORE_BASIC_INFORMATION
700 {
701 LONG CurrentCount;
702 LONG MaximumCount;
703 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
704
705 //
706 // Information Structures for NtQueryEvent
707 //
708 typedef struct _EVENT_BASIC_INFORMATION
709 {
710 EVENT_TYPE EventType;
711 LONG EventState;
712 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
713
714 //
715 // Information Structures for NtQuerySystemInformation
716 //
717 typedef struct _SYSTEM_BASIC_INFORMATION
718 {
719 ULONG Reserved;
720 ULONG TimerResolution;
721 ULONG PageSize;
722 ULONG NumberOfPhysicalPages;
723 ULONG LowestPhysicalPageNumber;
724 ULONG HighestPhysicalPageNumber;
725 ULONG AllocationGranularity;
726 ULONG MinimumUserModeAddress;
727 ULONG MaximumUserModeAddress;
728 KAFFINITY ActiveProcessorsAffinityMask;
729 CCHAR NumberOfProcessors;
730 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
731
732 // Class 1
733 typedef struct _SYSTEM_PROCESSOR_INFORMATION
734 {
735 USHORT ProcessorArchitecture;
736 USHORT ProcessorLevel;
737 USHORT ProcessorRevision;
738 USHORT Reserved;
739 ULONG ProcessorFeatureBits;
740 } SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
741
742 // Class 2
743 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
744 {
745 LARGE_INTEGER IdleProcessTime;
746 LARGE_INTEGER IoReadTransferCount;
747 LARGE_INTEGER IoWriteTransferCount;
748 LARGE_INTEGER IoOtherTransferCount;
749 ULONG IoReadOperationCount;
750 ULONG IoWriteOperationCount;
751 ULONG IoOtherOperationCount;
752 ULONG AvailablePages;
753 ULONG CommittedPages;
754 ULONG CommitLimit;
755 ULONG PeakCommitment;
756 ULONG PageFaultCount;
757 ULONG CopyOnWriteCount;
758 ULONG TransitionCount;
759 ULONG CacheTransitionCount;
760 ULONG DemandZeroCount;
761 ULONG PageReadCount;
762 ULONG PageReadIoCount;
763 ULONG CacheReadCount;
764 ULONG CacheIoCount;
765 ULONG DirtyPagesWriteCount;
766 ULONG DirtyWriteIoCount;
767 ULONG MappedPagesWriteCount;
768 ULONG MappedWriteIoCount;
769 ULONG PagedPoolPages;
770 ULONG NonPagedPoolPages;
771 ULONG PagedPoolAllocs;
772 ULONG PagedPoolFrees;
773 ULONG NonPagedPoolAllocs;
774 ULONG NonPagedPoolFrees;
775 ULONG FreeSystemPtes;
776 ULONG ResidentSystemCodePage;
777 ULONG TotalSystemDriverPages;
778 ULONG TotalSystemCodePages;
779 ULONG NonPagedPoolLookasideHits;
780 ULONG PagedPoolLookasideHits;
781 ULONG Spare3Count;
782 ULONG ResidentSystemCachePage;
783 ULONG ResidentPagedPoolPage;
784 ULONG ResidentSystemDriverPage;
785 ULONG CcFastReadNoWait;
786 ULONG CcFastReadWait;
787 ULONG CcFastReadResourceMiss;
788 ULONG CcFastReadNotPossible;
789 ULONG CcFastMdlReadNoWait;
790 ULONG CcFastMdlReadWait;
791 ULONG CcFastMdlReadResourceMiss;
792 ULONG CcFastMdlReadNotPossible;
793 ULONG CcMapDataNoWait;
794 ULONG CcMapDataWait;
795 ULONG CcMapDataNoWaitMiss;
796 ULONG CcMapDataWaitMiss;
797 ULONG CcPinMappedDataCount;
798 ULONG CcPinReadNoWait;
799 ULONG CcPinReadWait;
800 ULONG CcPinReadNoWaitMiss;
801 ULONG CcPinReadWaitMiss;
802 ULONG CcCopyReadNoWait;
803 ULONG CcCopyReadWait;
804 ULONG CcCopyReadNoWaitMiss;
805 ULONG CcCopyReadWaitMiss;
806 ULONG CcMdlReadNoWait;
807 ULONG CcMdlReadWait;
808 ULONG CcMdlReadNoWaitMiss;
809 ULONG CcMdlReadWaitMiss;
810 ULONG CcReadAheadIos;
811 ULONG CcLazyWriteIos;
812 ULONG CcLazyWritePages;
813 ULONG CcDataFlushes;
814 ULONG CcDataPages;
815 ULONG ContextSwitches;
816 ULONG FirstLevelTbFills;
817 ULONG SecondLevelTbFills;
818 ULONG SystemCalls;
819 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
820
821 // Class 3
822 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
823 {
824 LARGE_INTEGER BootTime;
825 LARGE_INTEGER CurrentTime;
826 LARGE_INTEGER TimeZoneBias;
827 ULONG TimeZoneId;
828 ULONG Reserved;
829 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
830
831 // Class 4
832 // This class is obsolete, please use KUSER_SHARED_DATA instead
833
834 // Class 5
835 typedef struct _SYSTEM_THREAD_INFORMATION
836 {
837 LARGE_INTEGER KernelTime;
838 LARGE_INTEGER UserTime;
839 LARGE_INTEGER CreateTime;
840 ULONG WaitTime;
841 PVOID StartAddress;
842 CLIENT_ID ClientId;
843 KPRIORITY Priority;
844 LONG BasePriority;
845 ULONG ContextSwitches;
846 ULONG ThreadState;
847 ULONG WaitReason;
848 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
849
850 typedef struct _SYSTEM_PROCESS_INFORMATION
851 {
852 ULONG NextEntryOffset;
853 ULONG NumberOfThreads;
854 LARGE_INTEGER SpareLi1;
855 LARGE_INTEGER SpareLi2;
856 LARGE_INTEGER SpareLi3;
857 LARGE_INTEGER CreateTime;
858 LARGE_INTEGER UserTime;
859 LARGE_INTEGER KernelTime;
860 UNICODE_STRING ImageName;
861 KPRIORITY BasePriority;
862 HANDLE UniqueProcessId;
863 HANDLE InheritedFromUniqueProcessId;
864 ULONG HandleCount;
865 ULONG SessionId;
866 ULONG UniqueProcessKey;
867
868 //
869 // This part corresponds to VM_COUNTERS_EX.
870 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
871 //
872 ULONG PeakVirtualSize;
873 ULONG VirtualSize;
874 ULONG PageFaultCount;
875 ULONG PeakWorkingSetSize;
876 ULONG WorkingSetSize;
877 ULONG QuotaPeakPagedPoolUsage;
878 ULONG QuotaPagedPoolUsage;
879 ULONG QuotaPeakNonPagedPoolUsage;
880 ULONG QuotaNonPagedPoolUsage;
881 ULONG PagefileUsage;
882 ULONG PeakPagefileUsage;
883 ULONG PrivatePageCount;
884
885 //
886 // This part corresponds to IO_COUNTERS
887 //
888 LARGE_INTEGER ReadOperationCount;
889 LARGE_INTEGER WriteOperationCount;
890 LARGE_INTEGER OtherOperationCount;
891 LARGE_INTEGER ReadTransferCount;
892 LARGE_INTEGER WriteTransferCount;
893 LARGE_INTEGER OtherTransferCount;
894
895 //SYSTEM_THREAD_INFORMATION TH[1];
896 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
897
898 // Class 6
899 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
900 {
901 ULONG Length;
902 ULONG NumberOfTables;
903 } SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
904
905 // Class 7
906 typedef struct _SYSTEM_DEVICE_INFORMATION
907 {
908 ULONG NumberOfDisks;
909 ULONG NumberOfFloppies;
910 ULONG NumberOfCdRoms;
911 ULONG NumberOfTapes;
912 ULONG NumberOfSerialPorts;
913 ULONG NumberOfParallelPorts;
914 } SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION;
915
916 // Class 8
917 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
918 {
919 LARGE_INTEGER IdleTime;
920 LARGE_INTEGER KernelTime;
921 LARGE_INTEGER UserTime;
922 LARGE_INTEGER DpcTime;
923 LARGE_INTEGER InterruptTime;
924 ULONG InterruptCount;
925 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
926
927 // Class 9
928 typedef struct _SYSTEM_FLAGS_INFORMATION
929 {
930 ULONG Flags;
931 } SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION;
932
933 // Class 10
934 typedef struct _SYSTEM_CALL_TIME_INFORMATION
935 {
936 ULONG Length;
937 ULONG TotalCalls;
938 LARGE_INTEGER TimeOfCalls[1];
939 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
940
941 // Class 11 - See RTL_PROCESS_MODULES
942
943 // Class 12 - See RTL_PROCESS_LOCKS
944
945 // Class 13 - See RTL_PROCESS_BACKTRACES
946
947 // Class 14 - 15
948 typedef struct _SYSTEM_POOL_ENTRY
949 {
950 BOOLEAN Allocated;
951 BOOLEAN Spare0;
952 USHORT AllocatorBackTraceIndex;
953 ULONG Size;
954 union
955 {
956 UCHAR Tag[4];
957 ULONG TagUlong;
958 PVOID ProcessChargedQuota;
959 };
960 } SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY;
961
962 typedef struct _SYSTEM_POOL_INFORMATION
963 {
964 ULONG TotalSize;
965 PVOID FirstEntry;
966 USHORT EntryOverhead;
967 BOOLEAN PoolTagPresent;
968 BOOLEAN Spare0;
969 ULONG NumberOfEntries;
970 SYSTEM_POOL_ENTRY Entries[1];
971 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
972
973 // Class 16
974 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
975 {
976 USHORT UniqueProcessId;
977 USHORT CreatorBackTraceIndex;
978 UCHAR ObjectTypeIndex;
979 UCHAR HandleAttributes;
980 USHORT HandleValue;
981 PVOID Object;
982 ULONG GrantedAccess;
983 } SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
984
985 typedef struct _SYSTEM_HANDLE_INFORMATION
986 {
987 ULONG NumberOfHandles;
988 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1];
989 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
990
991 // Class 17
992 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
993 {
994 ULONG NextEntryOffset;
995 ULONG NumberOfObjects;
996 ULONG NumberOfHandles;
997 ULONG TypeIndex;
998 ULONG InvalidAttributes;
999 GENERIC_MAPPING GenericMapping;
1000 ULONG ValidAccessMask;
1001 ULONG PoolType;
1002 BOOLEAN SecurityRequired;
1003 BOOLEAN WaitableObject;
1004 UNICODE_STRING TypeName;
1005 } SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION;
1006
1007 typedef struct _SYSTEM_OBJECT_INFORMATION
1008 {
1009 ULONG NextEntryOffset;
1010 PVOID Object;
1011 HANDLE CreatorUniqueProcess;
1012 USHORT CreatorBackTraceIndex;
1013 USHORT Flags;
1014 LONG PointerCount;
1015 LONG HandleCount;
1016 ULONG PagedPoolCharge;
1017 ULONG NonPagedPoolCharge;
1018 HANDLE ExclusiveProcessId;
1019 PVOID SecurityDescriptor;
1020 OBJECT_NAME_INFORMATION NameInfo;
1021 } SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
1022
1023 // Class 18
1024 typedef struct _SYSTEM_PAGEFILE_INFORMATION
1025 {
1026 ULONG NextEntryOffset;
1027 ULONG TotalSize;
1028 ULONG TotalInUse;
1029 ULONG PeakUsage;
1030 UNICODE_STRING PageFileName;
1031 } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
1032
1033 // Class 19
1034 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
1035 {
1036 ULONG SegmentNotPresent;
1037 ULONG VdmOpcode0F;
1038 ULONG OpcodeESPrefix;
1039 ULONG OpcodeCSPrefix;
1040 ULONG OpcodeSSPrefix;
1041 ULONG OpcodeDSPrefix;
1042 ULONG OpcodeFSPrefix;
1043 ULONG OpcodeGSPrefix;
1044 ULONG OpcodeOPER32Prefix;
1045 ULONG OpcodeADDR32Prefix;
1046 ULONG OpcodeINSB;
1047 ULONG OpcodeINSW;
1048 ULONG OpcodeOUTSB;
1049 ULONG OpcodeOUTSW;
1050 ULONG OpcodePUSHF;
1051 ULONG OpcodePOPF;
1052 ULONG OpcodeINTnn;
1053 ULONG OpcodeINTO;
1054 ULONG OpcodeIRET;
1055 ULONG OpcodeINBimm;
1056 ULONG OpcodeINWimm;
1057 ULONG OpcodeOUTBimm;
1058 ULONG OpcodeOUTWimm ;
1059 ULONG OpcodeINB;
1060 ULONG OpcodeINW;
1061 ULONG OpcodeOUTB;
1062 ULONG OpcodeOUTW;
1063 ULONG OpcodeLOCKPrefix;
1064 ULONG OpcodeREPNEPrefix;
1065 ULONG OpcodeREPPrefix;
1066 ULONG OpcodeHLT;
1067 ULONG OpcodeCLI;
1068 ULONG OpcodeSTI;
1069 ULONG BopCount;
1070 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
1071
1072 // Class 20 - ULONG VDMBOPINFO
1073
1074 // Class 21
1075 typedef struct _SYSTEM_FILECACHE_INFORMATION
1076 {
1077 ULONG CurrentSize;
1078 ULONG PeakSize;
1079 ULONG PageFaultCount;
1080 ULONG MinimumWorkingSet;
1081 ULONG MaximumWorkingSet;
1082 ULONG CurrentSizeIncludingTransitionInPages;
1083 ULONG PeakSizeIncludingTransitionInPages;
1084 ULONG TransitionRePurposeCount;
1085 ULONG Flags;
1086 } SYSTEM_FILECACHE_INFORMATION, *PSYSTEM_FILECACHE_INFORMATION;
1087
1088 // Class 22
1089 typedef struct _SYSTEM_POOLTAG
1090 {
1091 union
1092 {
1093 UCHAR Tag[4];
1094 ULONG TagUlong;
1095 };
1096 ULONG PagedAllocs;
1097 ULONG PagedFrees;
1098 ULONG PagedUsed;
1099 ULONG NonPagedAllocs;
1100 ULONG NonPagedFrees;
1101 ULONG NonPagedUsed;
1102 } SYSTEM_POOLTAG, *PSYSTEM_POOLTAG;
1103 typedef struct _SYSTEM_POOLTAG_INFORMATION
1104 {
1105 ULONG Count;
1106 SYSTEM_POOLTAG TagInfo[1];
1107 } SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION;
1108
1109 // Class 23
1110 typedef struct _SYSTEM_INTERRUPT_INFORMATION
1111 {
1112 ULONG ContextSwitches;
1113 ULONG DpcCount;
1114 ULONG DpcRate;
1115 ULONG TimeIncrement;
1116 ULONG DpcBypassCount;
1117 ULONG ApcBypassCount;
1118 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1119
1120 // Class 24
1121 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
1122 {
1123 ULONG Spare;
1124 ULONG DpcQueueDepth;
1125 ULONG MinimumDpcRate;
1126 ULONG AdjustDpcThreshold;
1127 ULONG IdealDpcRate;
1128 } SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION;
1129
1130 // Class 25
1131 typedef struct _SYSTEM_MEMORY_INFO
1132 {
1133 PUCHAR StringOffset;
1134 USHORT ValidCount;
1135 USHORT TransitionCount;
1136 USHORT ModifiedCount;
1137 USHORT PageTableCount;
1138 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
1139
1140 typedef struct _SYSTEM_MEMORY_INFORMATION
1141 {
1142 ULONG InfoSize;
1143 ULONG StringStart;
1144 SYSTEM_MEMORY_INFO Memory[1];
1145 } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION;
1146
1147 // Class 26
1148 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
1149 {
1150 UNICODE_STRING DriverName;
1151 PVOID ImageAddress;
1152 PVOID SectionPointer;
1153 PVOID EntryPoint;
1154 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
1155 ULONG ImageLength;
1156 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
1157
1158 // Class 27
1159 // Not an actually class, simply a PVOID to the ImageAddress
1160
1161 // Class 28
1162 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1163 {
1164 ULONG TimeAdjustment;
1165 ULONG TimeIncrement;
1166 BOOLEAN Enable;
1167 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION;
1168
1169 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1170 {
1171 ULONG TimeAdjustment;
1172 BOOLEAN Enable;
1173 } SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION;
1174
1175 // Class 29 - Same as 25
1176
1177 // FIXME: Class 30
1178
1179 // Class 31
1180 typedef struct _SYSTEM_REF_TRACE_INFORMATION
1181 {
1182 UCHAR TraceEnable;
1183 UCHAR TracePermanent;
1184 UNICODE_STRING TraceProcessName;
1185 UNICODE_STRING TracePoolTags;
1186 } SYSTEM_REF_TRACE_INFORMATION, *PSYSTEM_REF_TRACE_INFORMATION;
1187
1188 // Class 32 - OBSOLETE
1189
1190 // Class 33
1191 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1192 {
1193 ULONG AlignmentFixupCount;
1194 ULONG ExceptionDispatchCount;
1195 ULONG FloatingEmulationCount;
1196 ULONG ByteWordEmulationCount;
1197 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1198
1199 // Class 34
1200 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1201 {
1202 ULONG ValidCrashDump;
1203 } SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION;
1204
1205 // Class 35
1206 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1207 {
1208 BOOLEAN KernelDebuggerEnabled;
1209 BOOLEAN KernelDebuggerNotPresent;
1210 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1211
1212 // Class 36
1213 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1214 {
1215 ULONG ContextSwitches;
1216 ULONG FindAny;
1217 ULONG FindLast;
1218 ULONG FindIdeal;
1219 ULONG IdleAny;
1220 ULONG IdleCurrent;
1221 ULONG IdleLast;
1222 ULONG IdleIdeal;
1223 ULONG PreemptAny;
1224 ULONG PreemptCurrent;
1225 ULONG PreemptLast;
1226 ULONG SwitchToIdle;
1227 } SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION;
1228
1229 // Class 37
1230 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1231 {
1232 ULONG RegistryQuotaAllowed;
1233 ULONG RegistryQuotaUsed;
1234 ULONG PagedPoolSize;
1235 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1236
1237 // Class 38
1238 // Not a structure, simply send the UNICODE_STRING
1239
1240 // Class 39
1241 // Not a structure, simply send a ULONG containing the new separation
1242
1243 // Class 40
1244 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1245 {
1246 ULONG BusCount;
1247 PLUGPLAY_BUS_INSTANCE BusInstance[1];
1248 } SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION;
1249
1250 // Class 41
1251 typedef struct _SYSTEM_DOCK_INFORMATION
1252 {
1253 SYSTEM_DOCK_STATE DockState;
1254 INTERFACE_TYPE DeviceBusType;
1255 ULONG DeviceBusNumber;
1256 ULONG SlotNumber;
1257 } SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION;
1258
1259 // Class 42
1260 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1261 {
1262 BOOLEAN SystemSuspendSupported;
1263 BOOLEAN SystemHibernateSupported;
1264 BOOLEAN ResumeTimerSupportsSuspend;
1265 BOOLEAN ResumeTimerSupportsHibernate;
1266 BOOLEAN LidSupported;
1267 BOOLEAN TurboSettingSupported;
1268 BOOLEAN TurboMode;
1269 BOOLEAN SystemAcOrDc;
1270 BOOLEAN PowerDownDisabled;
1271 LARGE_INTEGER SpindownDrives;
1272 } SYSTEM_POWER_INFORMATION_NATIVE, *PSYSTEM_POWER_INFORMATION_NATIVE;
1273
1274 // Class 43
1275 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1276 {
1277 PNP_VETO_TYPE VetoType;
1278 UNICODE_STRING VetoDriver;
1279 // CHAR Buffer[0];
1280 } SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
1281
1282 // Class 44
1283 //typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1284
1285 // Class 45
1286 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1287 {
1288 USHORT CurrentDepth;
1289 USHORT MaximumDepth;
1290 ULONG TotalAllocates;
1291 ULONG AllocateMisses;
1292 ULONG TotalFrees;
1293 ULONG FreeMisses;
1294 ULONG Type;
1295 ULONG Tag;
1296 ULONG Size;
1297 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1298
1299 // Class 46
1300 // Not a structure. Only a HANDLE for the SlipEvent;
1301
1302 // Class 47
1303 // Not a structure. Only a ULONG for the SessionId;
1304
1305 // Class 48
1306 // Not a structure. Only a ULONG for the SessionId;
1307
1308 // FIXME: Class 49
1309
1310 // Class 50
1311 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1312
1313 // Class 51
1314 typedef struct _SYSTEM_VERIFIER_INFORMATION
1315 {
1316 ULONG NextEntryOffset;
1317 ULONG Level;
1318 UNICODE_STRING DriverName;
1319 ULONG RaiseIrqls;
1320 ULONG AcquireSpinLocks;
1321 ULONG SynchronizeExecutions;
1322 ULONG AllocationsAttempted;
1323 ULONG AllocationsSucceeded;
1324 ULONG AllocationsSucceededSpecialPool;
1325 ULONG AllocationsWithNoTag;
1326 ULONG TrimRequests;
1327 ULONG Trims;
1328 ULONG AllocationsFailed;
1329 ULONG AllocationsFailedDeliberately;
1330 ULONG Loads;
1331 ULONG Unloads;
1332 ULONG UnTrackedPool;
1333 ULONG CurrentPagedPoolAllocations;
1334 ULONG CurrentNonPagedPoolAllocations;
1335 ULONG PeakPagedPoolAllocations;
1336 ULONG PeakNonPagedPoolAllocations;
1337 ULONG PagedPoolUsageInBytes;
1338 ULONG NonPagedPoolUsageInBytes;
1339 ULONG PeakPagedPoolUsageInBytes;
1340 ULONG PeakNonPagedPoolUsageInBytes;
1341 } SYSTEM_VERIFIER_INFORMATION, *PSYSTEM_VERIFIER_INFORMATION;
1342
1343 // FIXME: Class 52
1344
1345 // Class 53
1346 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
1347 {
1348 ULONG SessionId;
1349 ULONG SizeOfBuf;
1350 PVOID Buffer; // Same format as in SystemProcessInformation
1351 } SYSTEM_SESSION_PROCESS_INFORMATION, *PSYSTEM_SESSION_PROCESS_INFORMATION;
1352
1353 // FIXME: Class 54-97
1354
1355 //
1356 // Hotpatch flags
1357 //
1358 #define RTL_HOTPATCH_SUPPORTED_FLAG 0x01
1359 #define RTL_HOTPATCH_SWAP_OBJECT_NAMES 0x08 << 24
1360 #define RTL_HOTPATCH_SYNC_RENAME_FILES 0x10 << 24
1361 #define RTL_HOTPATCH_PATCH_USER_MODE 0x20 << 24
1362 #define RTL_HOTPATCH_REMAP_SYSTEM_DLL 0x40 << 24
1363 #define RTL_HOTPATCH_PATCH_KERNEL_MODE 0x80 << 24
1364
1365
1366 // Class 69
1367 typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
1368 {
1369 ULONG Flags;
1370 ULONG InfoSize;
1371 union
1372 {
1373 struct
1374 {
1375 ULONG Foo;
1376 } CodeInfo;
1377 struct
1378 {
1379 USHORT NameOffset;
1380 USHORT NameLength;
1381 } KernelInfo;
1382 struct
1383 {
1384 USHORT NameOffset;
1385 USHORT NameLength;
1386 USHORT TargetNameOffset;
1387 USHORT TargetNameLength;
1388 UCHAR PatchingFinished;
1389 } UserModeInfo;
1390 struct
1391 {
1392 USHORT NameOffset;
1393 USHORT NameLength;
1394 USHORT TargetNameOffset;
1395 USHORT TargetNameLength;
1396 UCHAR PatchingFinished;
1397 NTSTATUS ReturnCode;
1398 HANDLE TargetProcess;
1399 } InjectionInfo;
1400 struct
1401 {
1402 HANDLE FileHandle1;
1403 PIO_STATUS_BLOCK IoStatusBlock1;
1404 PVOID RenameInformation1;
1405 PVOID RenameInformationLength1;
1406 HANDLE FileHandle2;
1407 PIO_STATUS_BLOCK IoStatusBlock2;
1408 PVOID RenameInformation2;
1409 PVOID RenameInformationLength2;
1410 } RenameInfo;
1411 struct
1412 {
1413 HANDLE ParentDirectory;
1414 HANDLE ObjectHandle1;
1415 HANDLE ObjectHandle2;
1416 } AtomicSwap;
1417 };
1418 } SYSTEM_HOTPATCH_CODE_INFORMATION, *PSYSTEM_HOTPATCH_CODE_INFORMATION;
1419
1420 //
1421 // Class 75
1422 //
1423 #ifdef NTOS_MODE_USER
1424 typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
1425 {
1426 ULONG ProviderSignature;
1427 BOOLEAN Register;
1428 PFNFTH FirmwareTableHandler;
1429 PVOID DriverObject;
1430 } SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
1431
1432 //
1433 // Class 76
1434 //
1435 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
1436 {
1437 ULONG ProviderSignature;
1438 SYSTEM_FIRMWARE_TABLE_ACTION Action;
1439 ULONG TableID;
1440 ULONG TableBufferLength;
1441 UCHAR TableBuffer[1];
1442 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
1443 #endif
1444 #endif