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