Move pushlock definition. It is gone from MS headers now.
[reactos.git] / reactos / include / ndk / extypes.h
1 /*++ NDK Version: 0095
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 (alex.ionescu@reactos.com) 06-Oct-2004
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 ExIoCompletionType;
47 extern POBJECT_TYPE NTSYSAPI ExMutantObjectType;
48 extern POBJECT_TYPE NTSYSAPI ExTimerType;
49
50 //
51 // Exported NT Build Number
52 //
53 extern ULONG NTSYSAPI NtBuildNumber;
54
55 //
56 // Invalid Handle Value Constant
57 //
58 #define INVALID_HANDLE_VALUE (HANDLE)-1
59
60 #endif
61
62 //
63 // Increments
64 //
65 #define MUTANT_INCREMENT 1
66
67 //
68 // Callback Object Access Mask
69 //
70 #define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
71 #define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
72 #define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
73 #define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
74
75 //
76 // Event Object Access Masks
77 //
78 #ifdef NTOS_MODE_USER
79 #define EVENT_QUERY_STATE 0x0001
80
81 //
82 // Semaphore Object Acess Masks
83 //
84 #define SEMAPHORE_QUERY_STATE 0x0001
85 #endif
86
87 //
88 // Event Pair Access Masks
89 //
90 #define EVENT_PAIR_ALL_ACCESS 0x1F0000L
91
92 //
93 // Profile Object Access Masks
94 //
95 #define PROFILE_CONTROL 0x0001
96 #define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
97
98 //
99 // Maximum Parameters for NtRaiseHardError
100 //
101 #define MAXIMUM_HARDERROR_PARAMETERS 4
102
103 //
104 // Pushlock bits
105 //
106 #define EX_PUSH_LOCK_LOCK_V ((ULONG_PTR)0x0)
107 #define EX_PUSH_LOCK_LOCK ((ULONG_PTR)0x1)
108 #define EX_PUSH_LOCK_WAITING ((ULONG_PTR)0x2)
109 #define EX_PUSH_LOCK_WAKING ((ULONG_PTR)0x4)
110 #define EX_PUSH_LOCK_MULTIPLE_SHARED ((ULONG_PTR)0x8)
111 #define EX_PUSH_LOCK_SHARE_INC ((ULONG_PTR)0x10)
112 #define EX_PUSH_LOCK_PTR_BITS ((ULONG_PTR)0xf)
113
114 //
115 // Pushlock Wait Block Flags
116 //
117 #define EX_PUSH_LOCK_FLAGS_EXCLUSIVE 1
118 #define EX_PUSH_LOCK_FLAGS_WAIT 2
119
120 //
121 // Shutdown types for NtShutdownSystem
122 //
123 typedef enum _SHUTDOWN_ACTION
124 {
125 ShutdownNoReboot,
126 ShutdownReboot,
127 ShutdownPowerOff
128 } SHUTDOWN_ACTION;
129
130 //
131 // Responses for NtRaiseHardError
132 //
133 typedef enum _HARDERROR_RESPONSE_OPTION
134 {
135 OptionAbortRetryIgnore,
136 OptionOk,
137 OptionOkCancel,
138 OptionRetryCancel,
139 OptionYesNo,
140 OptionYesNoCancel,
141 OptionShutdownSystem
142 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
143
144 typedef enum _HARDERROR_RESPONSE
145 {
146 ResponseReturnToCaller,
147 ResponseNotHandled,
148 ResponseAbort,
149 ResponseCancel,
150 ResponseIgnore,
151 ResponseNo,
152 ResponseOk,
153 ResponseRetry,
154 ResponseYes
155 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
156
157 //
158 // System Information Classes for NtQuerySystemInformation
159 //
160 typedef enum _SYSTEM_INFORMATION_CLASS
161 {
162 SystemBasicInformation,
163 SystemProcessorInformation,
164 SystemPerformanceInformation,
165 SystemTimeOfDayInformation,
166 SystemPathInformation, /// Obsolete: Use KUSER_SHARED_DATA
167 SystemProcessInformation,
168 SystemCallCountInformation,
169 SystemDeviceInformation,
170 SystemProcessorPerformanceInformation,
171 SystemFlagsInformation,
172 SystemCallTimeInformation,
173 SystemModuleInformation,
174 SystemLocksInformation,
175 SystemStackTraceInformation,
176 SystemPagedPoolInformation,
177 SystemNonPagedPoolInformation,
178 SystemHandleInformation,
179 SystemObjectInformation,
180 SystemPageFileInformation,
181 SystemVdmInstemulInformation,
182 SystemVdmBopInformation,
183 SystemFileCacheInformation,
184 SystemPoolTagInformation,
185 SystemInterruptInformation,
186 SystemDpcBehaviorInformation,
187 SystemFullMemoryInformation,
188 SystemLoadGdiDriverInformation,
189 SystemUnloadGdiDriverInformation,
190 SystemTimeAdjustmentInformation,
191 SystemSummaryMemoryInformation,
192 SystemNextEventIdInformation,
193 SystemEventIdsInformation,
194 SystemCrashDumpInformation,
195 SystemExceptionInformation,
196 SystemCrashDumpStateInformation,
197 SystemKernelDebuggerInformation,
198 SystemContextSwitchInformation,
199 SystemRegistryQuotaInformation,
200 SystemExtendServiceTableInformation,
201 SystemPrioritySeperation,
202 SystemPlugPlayBusInformation,
203 SystemDockInformation,
204 SystemPowerInformationNative,
205 SystemProcessorSpeedInformation,
206 SystemCurrentTimeZoneInformation,
207 SystemLookasideInformation,
208 SystemTimeSlipNotification,
209 SystemSessionCreate,
210 SystemSessionDetach,
211 SystemSessionInformation,
212 SystemRangeStartInformation,
213 SystemVerifierInformation,
214 SystemAddVerifier,
215 SystemSessionProcessesInformation,
216 SystemInformationClassMax
217 } SYSTEM_INFORMATION_CLASS;
218
219 //
220 // System Information Classes for NtQueryMutant
221 //
222 typedef enum _MUTANT_INFORMATION_CLASS
223 {
224 MutantBasicInformation
225 } MUTANT_INFORMATION_CLASS;
226
227 //
228 // System Information Classes for NtQueryAtom
229 //
230 typedef enum _ATOM_INFORMATION_CLASS
231 {
232 AtomBasicInformation,
233 AtomTableInformation,
234 } ATOM_INFORMATION_CLASS;
235
236 //
237 // System Information Classes for NtQueryTimer
238 //
239 typedef enum _TIMER_INFORMATION_CLASS
240 {
241 TimerBasicInformation
242 } TIMER_INFORMATION_CLASS;
243
244 //
245 // System Information Classes for NtQuerySemaphore
246 //
247 typedef enum _SEMAPHORE_INFORMATION_CLASS
248 {
249 SemaphoreBasicInformation
250 } SEMAPHORE_INFORMATION_CLASS;
251
252 //
253 // System Information Classes for NtQueryEvent
254 //
255 typedef enum _EVENT_INFORMATION_CLASS
256 {
257 EventBasicInformation
258 } EVENT_INFORMATION_CLASS;
259
260 #ifndef NTOS_MODE_USER
261
262 //
263 // Executive Work Queue Structures
264 //
265 typedef struct _EX_QUEUE_WORKER_INFO
266 {
267 ULONG QueueDisabled:1;
268 ULONG MakeThreadsAsNecessary:1;
269 ULONG WaitMode:1;
270 ULONG WorkerCount:29;
271 } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;
272
273 typedef struct _EX_WORK_QUEUE
274 {
275 KQUEUE WorkerQueue;
276 ULONG DynamicThreadCount;
277 ULONG WorkItemsProcessed;
278 ULONG WorkItemsProcessedLastPass;
279 ULONG QueueDepthLastPass;
280 EX_QUEUE_WORKER_INFO Info;
281 } EX_WORK_QUEUE, *PEX_WORK_QUEUE;
282
283 //
284 // Executive Fast Reference Structure
285 //
286 typedef struct _EX_FAST_REF
287 {
288 union
289 {
290 PVOID Object;
291 ULONG RefCnt:3;
292 ULONG Value;
293 };
294 } EX_FAST_REF, *PEX_FAST_REF;
295
296 //
297 // Executive Cache-Aware Rundown Reference Descriptor
298 //
299 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
300 {
301 union
302 {
303 ULONG_PTR Count;
304 PVOID Ptr;
305 };
306 PVOID PoolToFree;
307 } EX_RUNDOWN_REF_CACHE_AWARE, *PEX_RUNDOWN_REF_CACHE_AWARE;
308
309 //
310 // Executive Rundown Wait Block
311 //
312 typedef struct _EX_RUNDOWN_WAIT_BLOCK
313 {
314 ULONG_PTR Count;
315 KEVENT RundownEvent;
316 } EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
317
318 //
319 // Executive Pushlock
320 //
321 typedef struct _EX_PUSH_LOCK
322 {
323 union
324 {
325 struct
326 {
327 ULONG_PTR Locked:1;
328 ULONG_PTR Waiting:1;
329 ULONG_PTR Waking:1;
330 ULONG_PTR MultipleShared:1;
331 ULONG_PTR Shared:sizeof (ULONG_PTR) * 8 - 4;
332 };
333 ULONG_PTR Value;
334 PVOID Ptr;
335 };
336 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
337
338 //
339 // Executive Pushlock Wait Block
340 //
341 #ifndef __GNUC__ // WARNING! PUSHLOCKS WILL NOT WORK IN GCC FOR NOW!!!
342 __declspec(align(16))
343 #endif
344 typedef struct _EX_PUSH_LOCK_WAIT_BLOCK
345 {
346 union
347 {
348 KGATE WakeGate;
349 KEVENT WakeEvent;
350 };
351 struct _EX_PUSH_LOCK_WAIT_BLOCK *Next;
352 struct _EX_PUSH_LOCK_WAIT_BLOCK *Last;
353 struct _EX_PUSH_LOCK_WAIT_BLOCK *Previous;
354 LONG ShareCount;
355 LONG Flags;
356 #if DBG
357 BOOL Signaled;
358 EX_PUSH_LOCK NewValue;
359 EX_PUSH_LOCK OldValue;
360 PEX_PUSH_LOCK PushLock;
361 #endif
362 } EX_PUSH_LOCK_WAIT_BLOCK, *PEX_PUSH_LOCK_WAIT_BLOCK;
363
364 //
365 // Callback Object
366 //
367 typedef struct _CALLBACK_OBJECT
368 {
369 ULONG Name;
370 KSPIN_LOCK Lock;
371 LIST_ENTRY RegisteredCallbacks;
372 ULONG AllowMultipleCallbacks;
373 } CALLBACK_OBJECT , *PCALLBACK_OBJECT;
374
375 //
376 // Profile OBject
377 //
378 typedef struct _EPROFILE
379 {
380 PEPROCESS Process;
381 PVOID ImageBase;
382 SIZE_T ImageSize;
383 PVOID Buffer;
384 ULONG BufferSize;
385 ULONG BucketSize;
386 PKPROFILE KeProfile;
387 PVOID LockedBuffer;
388 PMDL Mdl;
389 ULONG Segment;
390 KPROFILE_SOURCE ProfileSource;
391 KAFFINITY Affinity;
392 } EPROFILE, *PEPROFILE;
393
394 //
395 // Handle Table Structures
396 //
397 typedef struct _HANDLE_TABLE_ENTRY_INFO
398 {
399 ULONG AuditMask;
400 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
401
402 typedef struct _HANDLE_TABLE_ENTRY
403 {
404 union
405 {
406 PVOID Object;
407 ULONG_PTR ObAttributes;
408 PHANDLE_TABLE_ENTRY_INFO InfoTable;
409 ULONG_PTR Value;
410 } u1;
411 union
412 {
413 ULONG GrantedAccess;
414 USHORT GrantedAccessIndex;
415 LONG NextFreeTableEntry;
416 } u2;
417 } HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
418
419 typedef struct _HANDLE_TABLE
420 {
421 ULONG Flags;
422 LONG HandleCount;
423 PHANDLE_TABLE_ENTRY **Table;
424 PEPROCESS QuotaProcess;
425 HANDLE UniqueProcessId;
426 LONG FirstFreeTableEntry;
427 LONG NextIndexNeedingPool;
428 ERESOURCE HandleTableLock;
429 LIST_ENTRY HandleTableList;
430 KEVENT HandleContentionEvent;
431 } HANDLE_TABLE, *PHANDLE_TABLE;
432
433 #endif
434
435 //
436 // Hard Error LPC Message
437 //
438 typedef struct _HARDERROR_MSG
439 {
440 PORT_MESSAGE h;
441 NTSTATUS Status;
442 LARGE_INTEGER ErrorTime;
443 ULONG ValidResponseOptions;
444 ULONG Response;
445 ULONG NumberOfParameters;
446 ULONG UnicodeStringParameterMask;
447 ULONG Parameters[MAXIMUM_HARDERROR_PARAMETERS];
448 } HARDERROR_MSG, *PHARDERROR_MSG;
449
450 //
451 // Information Structures for NtQueryMutant
452 //
453 typedef struct _MUTANT_BASIC_INFORMATION
454 {
455 LONG CurrentCount;
456 BOOLEAN OwnedByCaller;
457 BOOLEAN AbandonedState;
458 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
459
460 //
461 // Information Structures for NtQueryAtom
462 //
463 typedef struct _ATOM_BASIC_INFORMATION
464 {
465 USHORT UsageCount;
466 USHORT Flags;
467 USHORT NameLength;
468 WCHAR Name[1];
469 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
470
471 typedef struct _ATOM_TABLE_INFORMATION
472 {
473 ULONG NumberOfAtoms;
474 USHORT Atoms[1];
475 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
476
477 //
478 // Information Structures for NtQueryTimer
479 //
480 typedef struct _TIMER_BASIC_INFORMATION
481 {
482 LARGE_INTEGER TimeRemaining;
483 BOOLEAN SignalState;
484 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
485
486 //
487 // Information Structures for NtQuerySemaphore
488 //
489 typedef struct _SEMAPHORE_BASIC_INFORMATION
490 {
491 LONG CurrentCount;
492 LONG MaximumCount;
493 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
494
495 //
496 // Information Structures for NtQueryEvent
497 //
498 typedef struct _EVENT_BASIC_INFORMATION
499 {
500 EVENT_TYPE EventType;
501 LONG EventState;
502 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
503
504 //
505 // Information Structures for NtQuerySystemInformation
506 //
507 typedef struct _SYSTEM_BASIC_INFORMATION
508 {
509 ULONG Reserved;
510 ULONG TimerResolution;
511 ULONG PageSize;
512 ULONG NumberOfPhysicalPages;
513 ULONG LowestPhysicalPageNumber;
514 ULONG HighestPhysicalPageNumber;
515 ULONG AllocationGranularity;
516 ULONG MinimumUserModeAddress;
517 ULONG MaximumUserModeAddress;
518 KAFFINITY ActiveProcessorsAffinityMask;
519 CCHAR NumberOfProcessors;
520 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
521
522 // Class 1
523 typedef struct _SYSTEM_PROCESSOR_INFORMATION
524 {
525 USHORT ProcessorArchitecture;
526 USHORT ProcessorLevel;
527 USHORT ProcessorRevision;
528 USHORT Reserved;
529 ULONG ProcessorFeatureBits;
530 } SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
531
532 // Class 2
533 typedef struct _SYSTEM_PERFORMANCE_INFORMATION
534 {
535 LARGE_INTEGER IdleProcessTime;
536 LARGE_INTEGER IoReadTransferCount;
537 LARGE_INTEGER IoWriteTransferCount;
538 LARGE_INTEGER IoOtherTransferCount;
539 ULONG IoReadOperationCount;
540 ULONG IoWriteOperationCount;
541 ULONG IoOtherOperationCount;
542 ULONG AvailablePages;
543 ULONG CommittedPages;
544 ULONG CommitLimit;
545 ULONG PeakCommitment;
546 ULONG PageFaultCount;
547 ULONG CopyOnWriteCount;
548 ULONG TransitionCount;
549 ULONG CacheTransitionCount;
550 ULONG DemandZeroCount;
551 ULONG PageReadCount;
552 ULONG PageReadIoCount;
553 ULONG CacheReadCount;
554 ULONG CacheIoCount;
555 ULONG DirtyPagesWriteCount;
556 ULONG DirtyWriteIoCount;
557 ULONG MappedPagesWriteCount;
558 ULONG MappedWriteIoCount;
559 ULONG PagedPoolPages;
560 ULONG NonPagedPoolPages;
561 ULONG PagedPoolAllocs;
562 ULONG PagedPoolFrees;
563 ULONG NonPagedPoolAllocs;
564 ULONG NonPagedPoolFrees;
565 ULONG FreeSystemPtes;
566 ULONG ResidentSystemCodePage;
567 ULONG TotalSystemDriverPages;
568 ULONG TotalSystemCodePages;
569 ULONG NonPagedPoolLookasideHits;
570 ULONG PagedPoolLookasideHits;
571 ULONG Spare3Count;
572 ULONG ResidentSystemCachePage;
573 ULONG ResidentPagedPoolPage;
574 ULONG ResidentSystemDriverPage;
575 ULONG CcFastReadNoWait;
576 ULONG CcFastReadWait;
577 ULONG CcFastReadResourceMiss;
578 ULONG CcFastReadNotPossible;
579 ULONG CcFastMdlReadNoWait;
580 ULONG CcFastMdlReadWait;
581 ULONG CcFastMdlReadResourceMiss;
582 ULONG CcFastMdlReadNotPossible;
583 ULONG CcMapDataNoWait;
584 ULONG CcMapDataWait;
585 ULONG CcMapDataNoWaitMiss;
586 ULONG CcMapDataWaitMiss;
587 ULONG CcPinMappedDataCount;
588 ULONG CcPinReadNoWait;
589 ULONG CcPinReadWait;
590 ULONG CcPinReadNoWaitMiss;
591 ULONG CcPinReadWaitMiss;
592 ULONG CcCopyReadNoWait;
593 ULONG CcCopyReadWait;
594 ULONG CcCopyReadNoWaitMiss;
595 ULONG CcCopyReadWaitMiss;
596 ULONG CcMdlReadNoWait;
597 ULONG CcMdlReadWait;
598 ULONG CcMdlReadNoWaitMiss;
599 ULONG CcMdlReadWaitMiss;
600 ULONG CcReadAheadIos;
601 ULONG CcLazyWriteIos;
602 ULONG CcLazyWritePages;
603 ULONG CcDataFlushes;
604 ULONG CcDataPages;
605 ULONG ContextSwitches;
606 ULONG FirstLevelTbFills;
607 ULONG SecondLevelTbFills;
608 ULONG SystemCalls;
609 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
610
611 // Class 3
612 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
613 {
614 LARGE_INTEGER BootTime;
615 LARGE_INTEGER CurrentTime;
616 LARGE_INTEGER TimeZoneBias;
617 ULONG TimeZoneId;
618 ULONG Reserved;
619 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
620
621 // Class 4
622 // This class is obsolete, please use KUSER_SHARED_DATA instead
623
624 // Class 5
625 typedef struct _SYSTEM_THREAD_INFORMATION
626 {
627 LARGE_INTEGER KernelTime;
628 LARGE_INTEGER UserTime;
629 LARGE_INTEGER CreateTime;
630 ULONG WaitTime;
631 PVOID StartAddress;
632 CLIENT_ID ClientId;
633 KPRIORITY Priority;
634 LONG BasePriority;
635 ULONG ContextSwitches;
636 ULONG ThreadState;
637 ULONG WaitReason;
638 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
639
640 typedef struct _SYSTEM_PROCESS_INFORMATION
641 {
642 ULONG NextEntryOffset;
643 ULONG NumberOfThreads;
644 LARGE_INTEGER SpareLi1;
645 LARGE_INTEGER SpareLi2;
646 LARGE_INTEGER SpareLi3;
647 LARGE_INTEGER CreateTime;
648 LARGE_INTEGER UserTime;
649 LARGE_INTEGER KernelTime;
650 UNICODE_STRING ImageName;
651 KPRIORITY BasePriority;
652 HANDLE UniqueProcessId;
653 HANDLE InheritedFromUniqueProcessId;
654 ULONG HandleCount;
655 ULONG SessionId;
656 ULONG PageDirectoryFrame;
657
658 //
659 // This part corresponds to VM_COUNTERS_EX.
660 // NOTE: *NOT* THE SAME AS VM_COUNTERS!
661 //
662 ULONG PeakVirtualSize;
663 ULONG VirtualSize;
664 ULONG PageFaultCount;
665 ULONG PeakWorkingSetSize;
666 ULONG WorkingSetSize;
667 ULONG QuotaPeakPagedPoolUsage;
668 ULONG QuotaPagedPoolUsage;
669 ULONG QuotaPeakNonPagedPoolUsage;
670 ULONG QuotaNonPagedPoolUsage;
671 ULONG PagefileUsage;
672 ULONG PeakPagefileUsage;
673 ULONG PrivateUsage;
674
675 //
676 // This part corresponds to IO_COUNTERS
677 //
678 LARGE_INTEGER ReadOperationCount;
679 LARGE_INTEGER WriteOperationCount;
680 LARGE_INTEGER OtherOperationCount;
681 LARGE_INTEGER ReadTransferCount;
682 LARGE_INTEGER WriteTransferCount;
683 LARGE_INTEGER OtherTransferCount;
684
685 SYSTEM_THREAD_INFORMATION TH[1];
686 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
687
688 // Class 6
689 typedef struct _SYSTEM_CALL_COUNT_INFORMATION
690 {
691 ULONG Length;
692 ULONG NumberOfTables;
693 } SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION;
694
695 // Class 7
696 typedef struct _SYSTEM_DEVICE_INFORMATION
697 {
698 ULONG NumberOfDisks;
699 ULONG NumberOfFloppies;
700 ULONG NumberOfCdRoms;
701 ULONG NumberOfTapes;
702 ULONG NumberOfSerialPorts;
703 ULONG NumberOfParallelPorts;
704 } SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION;
705
706 // Class 8
707 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
708 {
709 LARGE_INTEGER IdleTime;
710 LARGE_INTEGER KernelTime;
711 LARGE_INTEGER UserTime;
712 LARGE_INTEGER DpcTime;
713 LARGE_INTEGER InterruptTime;
714 ULONG InterruptCount;
715 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
716
717 // Class 9
718 typedef struct _SYSTEM_FLAGS_INFORMATION
719 {
720 ULONG Flags;
721 } SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION;
722
723 // Class 10
724 typedef struct _SYSTEM_CALL_TIME_INFORMATION
725 {
726 ULONG Length;
727 ULONG TotalCalls;
728 LARGE_INTEGER TimeOfCalls[1];
729 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
730
731 // Class 11
732 typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY
733 {
734 ULONG Unknown1;
735 ULONG Unknown2;
736 PVOID Base;
737 ULONG Size;
738 ULONG Flags;
739 USHORT Index;
740 USHORT NameLength;
741 USHORT LoadCount;
742 USHORT PathLength;
743 CHAR ImageName[256];
744 } SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;
745 typedef struct _SYSTEM_MODULE_INFORMATION
746 {
747 ULONG Count;
748 SYSTEM_MODULE_INFORMATION_ENTRY Module[1];
749 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
750
751 // Class 12
752 typedef struct _SYSTEM_RESOURCE_LOCK_ENTRY
753 {
754 ULONG ResourceAddress;
755 ULONG Always1;
756 ULONG Unknown;
757 ULONG ActiveCount;
758 ULONG ContentionCount;
759 ULONG Unused[2];
760 ULONG NumberOfSharedWaiters;
761 ULONG NumberOfExclusiveWaiters;
762 } SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY;
763
764 typedef struct _SYSTEM_RESOURCE_LOCK_INFO
765 {
766 ULONG Count;
767 SYSTEM_RESOURCE_LOCK_ENTRY Lock[1];
768 } SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO;
769
770 // FIXME: Class 13
771 typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY
772 {
773 ULONG Dummy;
774 } SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY;
775
776 typedef struct _SYSTEM_BACKTRACE_INFORMATION
777 {
778 ULONG Unknown[4];
779 ULONG Count;
780 SYSTEM_BACKTRACE_INFORMATION_ENTRY Trace[1];
781 } SYSTEM_BACKTRACE_INFORMATION, *PSYSTEM_BACKTRACE_INFORMATION;
782
783 // Class 14 - 15
784 typedef struct _SYSTEM_POOL_ENTRY
785 {
786 BOOLEAN Allocated;
787 BOOLEAN Spare0;
788 USHORT AllocatorBackTraceIndex;
789 ULONG Size;
790 union
791 {
792 UCHAR Tag[4];
793 ULONG TagUlong;
794 PVOID ProcessChargedQuota;
795 };
796 } SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY;
797
798 typedef struct _SYSTEM_POOL_INFORMATION
799 {
800 ULONG TotalSize;
801 PVOID FirstEntry;
802 USHORT EntryOverhead;
803 BOOLEAN PoolTagPresent;
804 BOOLEAN Spare0;
805 ULONG NumberOfEntries;
806 SYSTEM_POOL_ENTRY Entries[1];
807 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
808
809 // Class 16
810 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO
811 {
812 USHORT UniqueProcessId;
813 USHORT CreatorBackTraceIndex;
814 UCHAR ObjectTypeIndex;
815 UCHAR HandleAttributes;
816 USHORT HandleValue;
817 PVOID Object;
818 ULONG GrantedAccess;
819 } SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
820
821 typedef struct _SYSTEM_HANDLE_INFORMATION
822 {
823 ULONG NumberOfHandles;
824 SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1];
825 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
826
827 // Class 17
828 typedef struct _SYSTEM_OBJECTTYPE_INFORMATION
829 {
830 ULONG NextEntryOffset;
831 ULONG NumberOfObjects;
832 ULONG NumberOfHandles;
833 ULONG TypeIndex;
834 ULONG InvalidAttributes;
835 GENERIC_MAPPING GenericMapping;
836 ULONG ValidAccessMask;
837 ULONG PoolType;
838 BOOLEAN SecurityRequired;
839 BOOLEAN WaitableObject;
840 UNICODE_STRING TypeName;
841 } SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION;
842
843 typedef struct _SYSTEM_OBJECT_INFORMATION
844 {
845 ULONG NextEntryOffset;
846 PVOID Object;
847 HANDLE CreatorUniqueProcess;
848 USHORT CreatorBackTraceIndex;
849 USHORT Flags;
850 LONG PointerCount;
851 LONG HandleCount;
852 ULONG PagedPoolCharge;
853 ULONG NonPagedPoolCharge;
854 HANDLE ExclusiveProcessId;
855 PVOID SecurityDescriptor;
856 OBJECT_NAME_INFORMATION NameInfo;
857 } SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
858
859 // Class 18
860 typedef struct _SYSTEM_PAGEFILE_INFORMATION
861 {
862 ULONG NextEntryOffset;
863 ULONG TotalSize;
864 ULONG TotalInUse;
865 ULONG PeakUsage;
866 UNICODE_STRING PageFileName;
867 } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
868
869 // Class 19
870 typedef struct _SYSTEM_VDM_INSTEMUL_INFO
871 {
872 ULONG SegmentNotPresent;
873 ULONG VdmOpcode0F;
874 ULONG OpcodeESPrefix;
875 ULONG OpcodeCSPrefix;
876 ULONG OpcodeSSPrefix;
877 ULONG OpcodeDSPrefix;
878 ULONG OpcodeFSPrefix;
879 ULONG OpcodeGSPrefix;
880 ULONG OpcodeOPER32Prefix;
881 ULONG OpcodeADDR32Prefix;
882 ULONG OpcodeINSB;
883 ULONG OpcodeINSW;
884 ULONG OpcodeOUTSB;
885 ULONG OpcodeOUTSW;
886 ULONG OpcodePUSHF;
887 ULONG OpcodePOPF;
888 ULONG OpcodeINTnn;
889 ULONG OpcodeINTO;
890 ULONG OpcodeIRET;
891 ULONG OpcodeINBimm;
892 ULONG OpcodeINWimm;
893 ULONG OpcodeOUTBimm;
894 ULONG OpcodeOUTWimm ;
895 ULONG OpcodeINB;
896 ULONG OpcodeINW;
897 ULONG OpcodeOUTB;
898 ULONG OpcodeOUTW;
899 ULONG OpcodeLOCKPrefix;
900 ULONG OpcodeREPNEPrefix;
901 ULONG OpcodeREPPrefix;
902 ULONG OpcodeHLT;
903 ULONG OpcodeCLI;
904 ULONG OpcodeSTI;
905 ULONG BopCount;
906 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
907
908 // FIXME: Class 20
909 typedef struct _SYSTEM_VDM_BOP_INFO
910 {
911 PVOID Dummy;
912 } SYSTEM_VDM_BOP_INFO, *PSYSTEM_VDM_BOP_INFO;
913
914 // Class 21
915 typedef struct _SYSTEM_CACHE_INFORMATION
916 {
917 ULONG CurrentSize;
918 ULONG PeakSize;
919 ULONG PageFaultCount;
920 ULONG MinimumWorkingSet;
921 ULONG MaximumWorkingSet;
922 ULONG CurrentSizeIncludingTransitionInPages;
923 ULONG PeakSizeIncludingTransitionInPages;
924 ULONG Unused[2];
925 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
926
927 // Class 22
928 typedef struct _SYSTEM_POOLTAG
929 {
930 union
931 {
932 UCHAR Tag[4];
933 ULONG TagUlong;
934 };
935 ULONG PagedAllocs;
936 ULONG PagedFrees;
937 ULONG PagedUsed;
938 ULONG NonPagedAllocs;
939 ULONG NonPagedFrees;
940 ULONG NonPagedUsed;
941 } SYSTEM_POOLTAG, *PSYSTEM_POOLTAG;
942 typedef struct _SYSTEM_POOLTAG_INFORMATION
943 {
944 ULONG Count;
945 SYSTEM_POOLTAG TagInfo[1];
946 } SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION;
947
948 // Class 23
949 typedef struct _SYSTEM_INTERRUPT_INFORMATION
950 {
951 ULONG ContextSwitches;
952 ULONG DpcCount;
953 ULONG DpcRate;
954 ULONG TimeIncrement;
955 ULONG DpcBypassCount;
956 ULONG ApcBypassCount;
957 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
958
959 // Class 24
960 typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION
961 {
962 ULONG Spare;
963 ULONG DpcQueueDepth;
964 ULONG MinimumDpcRate;
965 ULONG AdjustDpcThreshold;
966 ULONG IdealDpcRate;
967 } SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION;
968
969 // Class 25
970 typedef struct _SYSTEM_MEMORY_INFO
971 {
972 PUCHAR StringOffset;
973 USHORT ValidCount;
974 USHORT TransitionCount;
975 USHORT ModifiedCount;
976 USHORT PageTableCount;
977 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
978 typedef struct _SYSTEM_MEMORY_INFORMATION
979 {
980 ULONG InfoSize;
981 ULONG StringStart;
982 SYSTEM_MEMORY_INFO Memory[1];
983 } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION;
984
985 // Class 26
986 typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
987 {
988 UNICODE_STRING DriverName;
989 PVOID ImageAddress;
990 PVOID SectionPointer;
991 PVOID EntryPoint;
992 PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
993 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
994
995 // Class 27
996 // Not an actually class, simply a PVOID to the ImageAddress
997
998 // Class 28
999 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION
1000 {
1001 ULONG TimeAdjustment;
1002 ULONG TimeIncrement;
1003 BOOLEAN Enable;
1004 } SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION;
1005
1006 typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
1007 {
1008 ULONG TimeAdjustment;
1009 BOOLEAN Enable;
1010 } SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION;
1011
1012 // Class 29 - Same as 25
1013
1014 // FIXME: Class 30 - 31
1015
1016 // Class 32
1017 typedef struct _SYSTEM_CRASH_DUMP_INFORMATION
1018 {
1019 HANDLE CrashDumpSection;
1020 } SYSTEM_CRASH_DUMP_INFORMATION, *PSYSTEM_CRASH_DUMP_INFORMATION;
1021
1022 // Class 33
1023 typedef struct _SYSTEM_EXCEPTION_INFORMATION
1024 {
1025 ULONG AlignmentFixupCount;
1026 ULONG ExceptionDispatchCount;
1027 ULONG FloatingEmulationCount;
1028 ULONG ByteWordEmulationCount;
1029 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1030
1031 // Class 34
1032 typedef struct _SYSTEM_CRASH_STATE_INFORMATION
1033 {
1034 ULONG ValidCrashDump;
1035 } SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION;
1036
1037 // Class 35
1038 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
1039 {
1040 BOOLEAN KernelDebuggerEnabled;
1041 BOOLEAN KernelDebuggerNotPresent;
1042 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1043
1044 // Class 36
1045 typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION
1046 {
1047 ULONG ContextSwitches;
1048 ULONG FindAny;
1049 ULONG FindLast;
1050 ULONG FindIdeal;
1051 ULONG IdleAny;
1052 ULONG IdleCurrent;
1053 ULONG IdleLast;
1054 ULONG IdleIdeal;
1055 ULONG PreemptAny;
1056 ULONG PreemptCurrent;
1057 ULONG PreemptLast;
1058 ULONG SwitchToIdle;
1059 } SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION;
1060
1061 // Class 37
1062 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION
1063 {
1064 ULONG RegistryQuotaAllowed;
1065 ULONG RegistryQuotaUsed;
1066 ULONG PagedPoolSize;
1067 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1068
1069 // Class 38
1070 // Not a structure, simply send the UNICODE_STRING
1071
1072 // Class 39
1073 // Not a structure, simply send a ULONG containing the new separation
1074
1075 // Class 40
1076 typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION
1077 {
1078 ULONG BusCount;
1079 PLUGPLAY_BUS_INSTANCE BusInstance[1];
1080 } SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION;
1081
1082 // Class 41
1083 typedef struct _SYSTEM_DOCK_INFORMATION
1084 {
1085 SYSTEM_DOCK_STATE DockState;
1086 INTERFACE_TYPE DeviceBusType;
1087 ULONG DeviceBusNumber;
1088 ULONG SlotNumber;
1089 } SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION;
1090
1091 // Class 42
1092 typedef struct _SYSTEM_POWER_INFORMATION_NATIVE
1093 {
1094 BOOLEAN SystemSuspendSupported;
1095 BOOLEAN SystemHibernateSupported;
1096 BOOLEAN ResumeTimerSupportsSuspend;
1097 BOOLEAN ResumeTimerSupportsHibernate;
1098 BOOLEAN LidSupported;
1099 BOOLEAN TurboSettingSupported;
1100 BOOLEAN TurboMode;
1101 BOOLEAN SystemAcOrDc;
1102 BOOLEAN PowerDownDisabled;
1103 LARGE_INTEGER SpindownDrives;
1104 } SYSTEM_POWER_INFORMATION_NATIVE, *PSYSTEM_POWER_INFORMATION_NATIVE;
1105
1106 // Class 43
1107 typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
1108 {
1109 PNP_VETO_TYPE VetoType;
1110 UNICODE_STRING VetoDriver;
1111 // CHAR Buffer[0];
1112 } SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
1113
1114 // Class 44
1115 typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
1116
1117 // Class 45
1118 typedef struct _SYSTEM_LOOKASIDE_INFORMATION
1119 {
1120 USHORT CurrentDepth;
1121 USHORT MaximumDepth;
1122 ULONG TotalAllocates;
1123 ULONG AllocateMisses;
1124 ULONG TotalFrees;
1125 ULONG FreeMisses;
1126 ULONG Type;
1127 ULONG Tag;
1128 ULONG Size;
1129 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1130
1131 // Class 46
1132 // Not a structure. Only a HANDLE for the SlipEvent;
1133
1134 // Class 47
1135 // Not a structure. Only a ULONG for the SessionId;
1136
1137 // Class 48
1138 // Not a structure. Only a ULONG for the SessionId;
1139
1140 // FIXME: Class 49
1141
1142 // Class 50
1143 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
1144
1145 // FIXME: Class 51 (Based on MM_DRIVER_VERIFIER_DATA)
1146
1147 // FIXME: Class 52
1148
1149 // Class 53
1150 typedef struct _SYSTEM_SESSION_PROCESSES_INFORMATION
1151 {
1152 ULONG SessionId;
1153 ULONG BufferSize;
1154 PVOID Buffer; // Same format as in SystemProcessInformation
1155 } SYSTEM_SESSION_PROCESSES_INFORMATION, *PSYSTEM_SESSION_PROCESSES_INFORMATION;
1156
1157 #endif