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