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