1 /* $Id: sysinfo.c,v 1.10 2001/01/18 16:53:50 ekohl Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/ex/sysinfo.c
6 * PURPOSE: System information functions
7 * PROGRAMMER: David Welch (welch@mcmail.com)
12 /* INCLUDES *****************************************************************/
14 #include <ddk/ntddk.h>
15 #include <internal/ex.h>
16 #include <internal/ldr.h>
18 #include <internal/debug.h>
20 extern ULONG NtGlobalFlag
; /* FIXME: it should go in a ddk/?.h */
22 /* FUNCTIONS *****************************************************************/
26 NtQuerySystemEnvironmentValue (
27 IN PUNICODE_STRING Name
,
30 IN OUT PULONG ReturnLength
39 NtSetSystemEnvironmentValue (
40 IN PUNICODE_STRING VariableName
,
41 IN PUNICODE_STRING Value
48 /* --- Query/Set System Information --- */
52 * NOTE: QSI_DEF(n) and SSI_DEF(n) define _cdecl function symbols
53 * so the stack is popped only in one place on x86 platform.
55 #define QSI_USE(n) QSI##n
57 static NTSTATUS QSI_USE(n) (PVOID Buffer, ULONG Size, PULONG ReqSize)
59 #define SSI_USE(n) SSI##n
61 static NTSTATUS SSI_USE(n) (PVOID Buffer, ULONG Size)
63 /* Class 0 - Basic Information */
64 QSI_DEF(SystemBasicInformation
)
66 PSYSTEM_BASIC_INFORMATION Sbi
67 = (PSYSTEM_BASIC_INFORMATION
) Buffer
;
69 *ReqSize
= sizeof (SYSTEM_BASIC_INFORMATION
);
71 * Check user buffer's size
73 if (Size
< sizeof (SYSTEM_BASIC_INFORMATION
))
75 return (STATUS_INFO_LENGTH_MISMATCH
);
79 Sbi
->TimerResolution
= 0; /* FIXME */
80 Sbi
->PageSize
= PAGESIZE
; /* FIXME: it should be PAGE_SIZE */
81 Sbi
->NumberOfPhysicalPages
= 0; /* FIXME */
82 Sbi
->LowestPhysicalPageNumber
= 0; /* FIXME */
83 Sbi
->HighestPhysicalPageNumber
= 0; /* FIXME */
84 Sbi
->AllocationGranularity
= 65536; /* hard coded on Intel? */
85 Sbi
->MinimumUserModeAddress
= 0; /* FIXME */
86 Sbi
->MaximumUserModeAddress
= 0; /* FIXME */
87 Sbi
->ActiveProcessorsAffinityMask
= 0x00000001; /* FIXME */
88 Sbi
->NumberOfProcessors
= 1; /* FIXME */
90 return (STATUS_SUCCESS
);
93 /* Class 1 - Processor Information */
94 QSI_DEF(SystemProcessorInformation
)
96 PSYSTEM_PROCESSOR_INFORMATION Spi
97 = (PSYSTEM_PROCESSOR_INFORMATION
) Buffer
;
99 *ReqSize
= sizeof (SYSTEM_PROCESSOR_INFORMATION
);
101 * Check user buffer's size
103 if (Size
< sizeof (SYSTEM_PROCESSOR_INFORMATION
))
105 return (STATUS_INFO_LENGTH_MISMATCH
);
108 /* FIXME: add CPU type detection code */
109 Spi
->ProcessorArchitecture
= 0; /* FIXME */
110 Spi
->ProcessorLevel
= 0; /* FIXME */
111 Spi
->ProcessorRevision
= 0; /* FIXME */
113 Spi
->ProcessorFeatureBits
= 0x00000000; /* FIXME */
115 return (STATUS_SUCCESS
);
118 /* Class 2 - Performance Information */
119 QSI_DEF(SystemPerformanceInformation
)
121 PSYSTEM_PERFORMANCE_INFO Spi
122 = (PSYSTEM_PERFORMANCE_INFO
) Buffer
;
124 *ReqSize
= sizeof (SYSTEM_PERFORMANCE_INFO
);
126 * Check user buffer's size
128 if (Size
< sizeof (SYSTEM_PERFORMANCE_INFO
))
130 return (STATUS_INFO_LENGTH_MISMATCH
);
133 Spi
->IdleProcessorTime
.QuadPart
= 0; /* FIXME */
134 Spi
->IoReadTransferCount
.QuadPart
= 0; /* FIXME */
135 Spi
->IoWriteTransferCount
.QuadPart
= 0; /* FIXME */
136 Spi
->IoOtherTransferCount
.QuadPart
= 0; /* FIXME */
137 Spi
->IoReadOperationCount
= 0; /* FIXME */
138 Spi
->IoWriteOperationCount
= 0; /* FIXME */
139 Spi
->IoOtherOperationCount
= 0; /* FIXME */
140 Spi
->AvailablePages
= 0; /* FIXME */
141 Spi
->CommitedPages
= 0; /* FIXME */
142 Spi
->CommitLimit
= 0; /* FIXME */
143 Spi
->PeakCommitment
= 0; /* FIXME */
144 Spi
->PageFaultCount
= 0; /* FIXME */
145 Spi
->CopyOnWriteCount
= 0; /* FIXME */
146 Spi
->TransitionCount
= 0; /* FIXME */
147 Spi
->CacheTransitionCount
= 0; /* FIXME */
148 Spi
->DemandZeroCount
= 0; /* FIXME */
149 Spi
->PageReadCount
= 0; /* FIXME */
150 Spi
->PageReadIoCount
= 0; /* FIXME */
151 Spi
->CacheReadCount
= 0; /* FIXME */
152 Spi
->CacheIoCount
= 0; /* FIXME */
153 Spi
->DirtyPagesWriteCount
= 0; /* FIXME */
154 Spi
->DirtyWriteIoCount
= 0; /* FIXME */
155 Spi
->MappedPagesWriteCount
= 0; /* FIXME */
156 Spi
->MappedWriteIoCount
= 0; /* FIXME */
157 Spi
->PagedPoolPages
= 0; /* FIXME */
158 Spi
->NonPagedPoolPages
= 0; /* FIXME */
159 Spi
->Unknown6
= 0; /* FIXME */
160 Spi
->Unknown7
= 0; /* FIXME */
161 Spi
->Unknown8
= 0; /* FIXME */
162 Spi
->Unknown9
= 0; /* FIXME */
163 Spi
->MmTotalSystemFreePtes
= 0; /* FIXME */
164 Spi
->MmSystemCodepage
= 0; /* FIXME */
165 Spi
->MmTotalSystemDriverPages
= 0; /* FIXME */
166 Spi
->MmTotalSystemCodePages
= 0; /* FIXME */
167 Spi
->Unknown10
= 0; /* FIXME */
168 Spi
->Unknown11
= 0; /* FIXME */
169 Spi
->Unknown12
= 0; /* FIXME */
170 Spi
->MmSystemCachePage
= 0; /* FIXME */
171 Spi
->MmPagedPoolPage
= 0; /* FIXME */
172 Spi
->MmSystemDriverPage
= 0; /* FIXME */
173 Spi
->CcFastReadNoWait
= 0; /* FIXME */
174 Spi
->CcFastReadWait
= 0; /* FIXME */
175 Spi
->CcFastReadResourceMiss
= 0; /* FIXME */
176 Spi
->CcFastReadNotPossible
= 0; /* FIXME */
177 Spi
->CcFastMdlReadNoWait
= 0; /* FIXME */
178 Spi
->CcFastMdlReadWait
= 0; /* FIXME */
179 Spi
->CcFastMdlReadResourceMiss
= 0; /* FIXME */
180 Spi
->CcFastMdlReadNotPossible
= 0; /* FIXME */
181 Spi
->CcMapDataNoWait
= 0; /* FIXME */
182 Spi
->CcMapDataWait
= 0; /* FIXME */
183 Spi
->CcMapDataNoWaitMiss
= 0; /* FIXME */
184 Spi
->CcMapDataWaitMiss
= 0; /* FIXME */
185 Spi
->CcPinMappedDataCount
= 0; /* FIXME */
186 Spi
->CcPinReadNoWait
= 0; /* FIXME */
187 Spi
->CcPinReadWait
= 0; /* FIXME */
188 Spi
->CcPinReadNoWaitMiss
= 0; /* FIXME */
189 Spi
->CcPinReadWaitMiss
= 0; /* FIXME */
190 Spi
->CcCopyReadNoWait
= 0; /* FIXME */
191 Spi
->CcCopyReadWait
= 0; /* FIXME */
192 Spi
->CcCopyReadNoWaitMiss
= 0; /* FIXME */
193 Spi
->CcCopyReadWaitMiss
= 0; /* FIXME */
194 Spi
->CcMdlReadNoWait
= 0; /* FIXME */
195 Spi
->CcMdlReadWait
= 0; /* FIXME */
196 Spi
->CcMdlReadNoWaitMiss
= 0; /* FIXME */
197 Spi
->CcMdlReadWaitMiss
= 0; /* FIXME */
198 Spi
->CcReadaheadIos
= 0; /* FIXME */
199 Spi
->CcLazyWriteIos
= 0; /* FIXME */
200 Spi
->CcLazyWritePages
= 0; /* FIXME */
201 Spi
->CcDataFlushes
= 0; /* FIXME */
202 Spi
->CcDataPages
= 0; /* FIXME */
203 Spi
->ContextSwitches
= 0; /* FIXME */
204 Spi
->Unknown13
= 0; /* FIXME */
205 Spi
->Unknown14
= 0; /* FIXME */
206 Spi
->SystemCalls
= 0; /* FIXME */
208 return (STATUS_SUCCESS
);
211 /* Class 3 - Time Of Day Information */
212 QSI_DEF(SystemTimeOfDayInformation
)
214 PSYSTEM_TIMEOFDAY_INFORMATION Sti
215 = (PSYSTEM_TIMEOFDAY_INFORMATION
) Buffer
;
217 *ReqSize
= sizeof (SYSTEM_TIMEOFDAY_INFORMATION
);
219 * Check user buffer's size
221 if (Size
< sizeof (SYSTEM_TIMEOFDAY_INFORMATION
))
223 return (STATUS_INFO_LENGTH_MISMATCH
);
226 Sti
->BootTime
.QuadPart
= 0; /* FIXME */
227 Sti
->CurrentTime
.QuadPart
= 0; /* FIXME */
228 Sti
->TimeZoneBias
.QuadPart
= 0; /* FIXME */
229 Sti
->TimeZoneId
= 0; /* FIXME */
230 Sti
->Reserved
= 0; /* FIXME */
232 return (STATUS_SUCCESS
);
235 /* Class 4 - Path Information */
236 QSI_DEF(SystemPathInformation
)
238 /* FIXME: QSI returns STATUS_BREAKPOINT. Why? */
239 return (STATUS_BREAKPOINT
);
242 /* Class 5 - Process Information */
243 QSI_DEF(SystemProcessInformation
)
245 /* FIXME: scan the process+thread list */
246 return (STATUS_NOT_IMPLEMENTED
);
249 /* Class 6 - Call Count Information */
250 QSI_DEF(SystemCallCountInformation
)
253 return (STATUS_NOT_IMPLEMENTED
);
256 /* Class 7 - Device Information */
257 QSI_DEF(SystemDeviceInformation
)
259 PSYSTEM_DEVICE_INFORMATION Sdi
260 = (PSYSTEM_DEVICE_INFORMATION
) Buffer
;
261 PCONFIGURATION_INFORMATION ConfigInfo
;
263 *ReqSize
= sizeof (SYSTEM_DEVICE_INFORMATION
);
265 * Check user buffer's size
267 if (Size
< sizeof (SYSTEM_DEVICE_INFORMATION
))
269 return (STATUS_INFO_LENGTH_MISMATCH
);
272 ConfigInfo
= IoGetConfigurationInformation ();
274 Sdi
->NumberOfDisks
= ConfigInfo
->DiskCount
;
275 Sdi
->NumberOfFloppies
= ConfigInfo
->FloppyCount
;
276 Sdi
->NumberOfCdRoms
= ConfigInfo
->CDRomCount
;
277 Sdi
->NumberOfTapes
= ConfigInfo
->TapeCount
;
278 Sdi
->NumberOfSerialPorts
= ConfigInfo
->SerialCount
;
279 Sdi
->NumberOfParallelPorts
= ConfigInfo
->ParallelCount
;
281 return (STATUS_SUCCESS
);
284 /* Class 8 - Processor Performance Information */
285 QSI_DEF(SystemProcessorPerformanceInformation
)
288 return (STATUS_NOT_IMPLEMENTED
);
291 /* Class 9 - Flags Information */
292 QSI_DEF(SystemFlagsInformation
)
294 if (sizeof (SYSTEM_FLAGS_INFORMATION
) != Size
)
296 * ReqSize
= sizeof (SYSTEM_FLAGS_INFORMATION
);
297 return (STATUS_INFO_LENGTH_MISMATCH
);
299 ((PSYSTEM_FLAGS_INFORMATION
) Buffer
)->Flags
= NtGlobalFlag
;
300 return (STATUS_SUCCESS
);
303 SSI_DEF(SystemFlagsInformation
)
305 if (sizeof (SYSTEM_FLAGS_INFORMATION
) != Size
)
307 return (STATUS_INFO_LENGTH_MISMATCH
);
309 NtGlobalFlag
= ((PSYSTEM_FLAGS_INFORMATION
) Buffer
)->Flags
;
310 return (STATUS_SUCCESS
);
313 /* Class 10 - Call Time Information */
314 QSI_DEF(SystemCallTimeInformation
)
317 return (STATUS_NOT_IMPLEMENTED
);
320 /* Class 11 - Module Information */
321 QSI_DEF(SystemModuleInformation
)
323 return LdrpQueryModuleInformation(Buffer
, Size
, ReqSize
);
326 /* Class 12 - Locks Information */
327 QSI_DEF(SystemLocksInformation
)
330 return (STATUS_NOT_IMPLEMENTED
);
333 /* Class 13 - Stack Trace Information */
334 QSI_DEF(SystemStackTraceInformation
)
337 return (STATUS_NOT_IMPLEMENTED
);
340 /* Class 14 - Paged Pool Information */
341 QSI_DEF(SystemPagedPoolInformation
)
344 return (STATUS_NOT_IMPLEMENTED
);
347 /* Class 15 - Non Paged Pool Information */
348 QSI_DEF(SystemNonPagedPoolInformation
)
351 return (STATUS_NOT_IMPLEMENTED
);
354 /* Class 16 - Handle Information */
355 QSI_DEF(SystemHandleInformation
)
358 return (STATUS_NOT_IMPLEMENTED
);
361 /* Class 17 - Information */
362 QSI_DEF(SystemObjectInformation
)
365 return (STATUS_NOT_IMPLEMENTED
);
368 /* Class 18 - Information */
369 QSI_DEF(SystemPageFileInformation
)
372 return (STATUS_NOT_IMPLEMENTED
);
375 /* Class 19 - Vdm Instemul Information */
376 QSI_DEF(SystemVdmInstemulInformation
)
379 return (STATUS_NOT_IMPLEMENTED
);
382 /* Class 20 - Vdm Bop Information */
383 QSI_DEF(SystemVdmBopInformation
)
386 return (STATUS_NOT_IMPLEMENTED
);
389 /* Class 21 - File Cache Information */
390 QSI_DEF(SystemFileCacheInformation
)
392 if (Size
< sizeof (SYSTEM_CACHE_INFORMATION
))
394 * ReqSize
= sizeof (SYSTEM_CACHE_INFORMATION
);
395 return (STATUS_INFO_LENGTH_MISMATCH
);
398 return (STATUS_NOT_IMPLEMENTED
);
401 SSI_DEF(SystemFileCacheInformation
)
403 if (Size
< sizeof (SYSTEM_CACHE_INFORMATION
))
405 return (STATUS_INFO_LENGTH_MISMATCH
);
408 return (STATUS_NOT_IMPLEMENTED
);
411 /* Class 22 - Pool Tag Information */
412 QSI_DEF(SystemPoolTagInformation
)
415 return (STATUS_NOT_IMPLEMENTED
);
418 /* Class 23 - Interrupt Information */
419 QSI_DEF(SystemInterruptInformation
)
422 return (STATUS_NOT_IMPLEMENTED
);
425 /* Class 24 - DPC Behaviour Information */
426 QSI_DEF(SystemDpcBehaviourInformation
)
429 return (STATUS_NOT_IMPLEMENTED
);
432 SSI_DEF(SystemDpcBehaviourInformation
)
435 return (STATUS_NOT_IMPLEMENTED
);
438 /* Class 25 - Full Memory Information */
439 QSI_DEF(SystemFullMemoryInformation
)
442 return (STATUS_NOT_IMPLEMENTED
);
445 /* Class 26 - Load Gdi Driver Information */
446 SSI_DEF(SystemLoadGdiDriverInformation
)
448 PSYSTEM_GDI_DRIVER_INFORMATION Sdi
449 = (PSYSTEM_GDI_DRIVER_INFORMATION
) Buffer
;
451 if (sizeof (SYSTEM_GDI_DRIVER_INFORMATION
) != Size
)
453 return (STATUS_INFO_LENGTH_MISMATCH
);
456 return LdrLoadGdiDriver (&Sdi
->DriverName
,
458 &Sdi
->SectionPointer
,
460 &Sdi
->ExportSectionPointer
);
463 /* Class 27 - Unload Gdi Driver Information */
464 SSI_DEF(SystemUnloadGdiDriverInformation
)
467 return (STATUS_NOT_IMPLEMENTED
);
470 /* Class 28 - Time Adjustment Information */
471 QSI_DEF(SystemTimeAdjustmentInformation
)
473 if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
) > Size
)
475 * ReqSize
= sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
);
476 return (STATUS_INFO_LENGTH_MISMATCH
);
479 return (STATUS_NOT_IMPLEMENTED
);
482 SSI_DEF(SystemTimeAdjustmentInformation
)
484 if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
) > Size
)
486 return (STATUS_INFO_LENGTH_MISMATCH
);
489 return (STATUS_NOT_IMPLEMENTED
);
492 /* Class 29 - Summary Memory Information */
493 QSI_DEF(SystemSummaryMemoryInformation
)
496 return (STATUS_NOT_IMPLEMENTED
);
499 /* Class 30 - Next Event Id Information */
500 QSI_DEF(SystemNextEventIdInformation
)
503 return (STATUS_NOT_IMPLEMENTED
);
506 /* Class 31 - Event Ids Information */
507 QSI_DEF(SystemEventIdsInformation
)
510 return (STATUS_NOT_IMPLEMENTED
);
513 /* Class 32 - Crach Dump Information */
514 QSI_DEF(SystemCrashDumpInformation
)
517 return (STATUS_NOT_IMPLEMENTED
);
520 /* Class 33 - Exception Information */
521 QSI_DEF(SystemExceptionInformation
)
524 return (STATUS_NOT_IMPLEMENTED
);
527 /* Class 34 - Crach Dump State Information */
528 QSI_DEF(SystemCrashDumpStateInformation
)
531 return (STATUS_NOT_IMPLEMENTED
);
534 /* Class 35 - Kernel Debugger Information */
535 QSI_DEF(SystemKernelDebuggerInformation
)
538 return (STATUS_NOT_IMPLEMENTED
);
541 /* Class 36 - Context Switch Information */
542 QSI_DEF(SystemContextSwitchInformation
)
545 return (STATUS_NOT_IMPLEMENTED
);
548 /* Class 37 - Registry Quota Information */
549 QSI_DEF(SystemRegistryQuotaInformation
)
552 return (STATUS_NOT_IMPLEMENTED
);
555 SSI_DEF(SystemRegistryQuotaInformation
)
558 return (STATUS_NOT_IMPLEMENTED
);
561 /* Class 38 - Extend Service Table Information */
562 SSI_DEF(SystemExtendServiceTableInformation
)
565 return (STATUS_NOT_IMPLEMENTED
);
568 /* Class 39 - Priority Seperation */
569 SSI_DEF(SystemPrioritySeperation
)
572 return (STATUS_NOT_IMPLEMENTED
);
575 /* Class 40 - Plug Play Bus Information */
576 QSI_DEF(SystemPlugPlayBusInformation
)
579 return (STATUS_NOT_IMPLEMENTED
);
582 /* Class 41 - Dock Information */
583 QSI_DEF(SystemDockInformation
)
586 return (STATUS_NOT_IMPLEMENTED
);
589 /* Class 42 - Power Information */
590 QSI_DEF(SystemPowerInformation
)
593 return (STATUS_NOT_IMPLEMENTED
);
596 /* Class 43 - Processor Speed Information */
597 QSI_DEF(SystemProcessorSpeedInformation
)
600 return (STATUS_NOT_IMPLEMENTED
);
603 /* Class 44 - Current Time Zone Information */
604 QSI_DEF(SystemCurrentTimeZoneInformation
)
606 * ReqSize
= sizeof (TIME_ZONE_INFORMATION
);
608 if (sizeof (TIME_ZONE_INFORMATION
) != Size
)
610 return (STATUS_INFO_LENGTH_MISMATCH
);
612 /* Copy the time zone information struct */
615 & SystemTimeZoneInfo
,
616 sizeof (TIME_ZONE_INFORMATION
)
619 return (STATUS_SUCCESS
);
623 SSI_DEF(SystemCurrentTimeZoneInformation
)
626 * Check user buffer's size
628 if (Size
< sizeof (TIME_ZONE_INFORMATION
))
630 return (STATUS_INFO_LENGTH_MISMATCH
);
632 /* Copy the time zone information struct */
634 & SystemTimeZoneInfo
,
635 (TIME_ZONE_INFORMATION
*) Buffer
,
636 sizeof (TIME_ZONE_INFORMATION
)
638 return (STATUS_SUCCESS
);
642 /* Class 45 - Lookaside Information */
643 QSI_DEF(SystemLookasideInformation
)
646 return (STATUS_NOT_IMPLEMENTED
);
650 /* Query/Set Calls Table */
654 NTSTATUS (* Query
) (PVOID
,ULONG
,PULONG
);
655 NTSTATUS (* Set
) (PVOID
,ULONG
);
662 // XX unknown behaviour
664 #define SI_QS(n) {QSI_USE(n),SSI_USE(n)}
665 #define SI_QX(n) {QSI_USE(n),NULL}
666 #define SI_XS(n) {NULL,SSI_USE(n)}
667 #define SI_XX(n) {NULL,NULL}
673 SI_QX(SystemBasicInformation
),
674 SI_QX(SystemProcessorInformation
),
675 SI_QX(SystemPerformanceInformation
),
676 SI_QX(SystemTimeOfDayInformation
),
677 SI_QX(SystemPathInformation
), /* should be SI_XX */
678 SI_QX(SystemProcessInformation
),
679 SI_QX(SystemCallCountInformation
),
680 SI_QX(SystemDeviceInformation
),
681 SI_QX(SystemProcessorPerformanceInformation
),
682 SI_QS(SystemFlagsInformation
),
683 SI_QX(SystemCallTimeInformation
), /* should be SI_XX */
684 SI_QX(SystemModuleInformation
),
685 SI_QX(SystemLocksInformation
),
686 SI_QX(SystemStackTraceInformation
), /* should be SI_XX */
687 SI_QX(SystemPagedPoolInformation
), /* should be SI_XX */
688 SI_QX(SystemNonPagedPoolInformation
), /* should be SI_XX */
689 SI_QX(SystemHandleInformation
),
690 SI_QX(SystemObjectInformation
),
691 SI_QX(SystemPageFileInformation
),
692 SI_QX(SystemVdmInstemulInformation
),
693 SI_QX(SystemVdmBopInformation
), /* it should be SI_XX */
694 SI_QS(SystemFileCacheInformation
),
695 SI_QX(SystemPoolTagInformation
),
696 SI_QX(SystemInterruptInformation
),
697 SI_QS(SystemDpcBehaviourInformation
),
698 SI_QX(SystemFullMemoryInformation
), /* it should be SI_XX */
699 SI_XS(SystemLoadGdiDriverInformation
),
700 SI_XS(SystemUnloadGdiDriverInformation
),
701 SI_QS(SystemTimeAdjustmentInformation
),
702 SI_QX(SystemSummaryMemoryInformation
), /* it should be SI_XX */
703 SI_QX(SystemNextEventIdInformation
), /* it should be SI_XX */
704 SI_QX(SystemEventIdsInformation
), /* it should be SI_XX */
705 SI_QX(SystemCrashDumpInformation
),
706 SI_QX(SystemExceptionInformation
),
707 SI_QX(SystemCrashDumpStateInformation
),
708 SI_QX(SystemKernelDebuggerInformation
),
709 SI_QX(SystemContextSwitchInformation
),
710 SI_QS(SystemRegistryQuotaInformation
),
711 SI_XS(SystemExtendServiceTableInformation
),
712 SI_XS(SystemPrioritySeperation
),
713 SI_QX(SystemPlugPlayBusInformation
), /* it should be SI_XX */
714 SI_QX(SystemDockInformation
), /* it should be SI_XX */
715 SI_QX(SystemPowerInformation
), /* it should be SI_XX */
716 SI_QX(SystemProcessorSpeedInformation
), /* it should be SI_XX */
717 SI_QS(SystemCurrentTimeZoneInformation
), /* it should be SI_QX */
718 SI_QX(SystemLookasideInformation
)
724 NtQuerySystemInformation (
725 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
726 OUT PVOID SystemInformation
,
728 OUT PULONG ResultLength
732 * If called from user mode, check
733 * possible unsafe arguments.
736 if (KernelMode
!= KeGetPreviousMode())
740 // SystemInformation,
750 * Clear the user buffer.
752 RtlZeroMemory (SystemInformation
, Length
);
754 * Check the request is valid.
756 if ( (SystemInformationClass
>= SystemInformationClassMin
)
757 && (SystemInformationClass
< SystemInformationClassMax
)
760 if (NULL
!= CallQS
[SystemInformationClass
].Query
)
763 * Hand the request to a subhandler.
765 return CallQS
[SystemInformationClass
].Query (
772 return (STATUS_INVALID_INFO_CLASS
);
778 NtSetSystemInformation (
779 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
780 IN PVOID SystemInformation
,
781 IN ULONG SystemInformationLength
785 * If called from user mode, check
786 * possible unsafe arguments.
789 if (KernelMode
!= KeGetPreviousMode())
793 // SystemInformation,
803 * Check the request is valid.
805 if ( (SystemInformationClass
>= SystemInformationClassMin
)
806 && (SystemInformationClass
< SystemInformationClassMax
)
809 if (NULL
!= CallQS
[SystemInformationClass
].Set
)
812 * Hand the request to a subhandler.
814 return CallQS
[SystemInformationClass
].Set (
816 SystemInformationLength
820 return (STATUS_INVALID_INFO_CLASS
);
826 NtFlushInstructionCache (
827 IN HANDLE ProcessHandle
,
828 IN PVOID BaseAddress
,
829 IN UINT NumberOfBytesToFlush