1 /* $Id: sysinfo.c,v 1.7 2000/10/22 16:36:49 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
->KeMaximumIncrement
= 0; /* FIXME */
80 Sbi
->MmPageSize
= PAGESIZE
; /* FIXME: it should be PAGE_SIZE */
81 Sbi
->MmNumberOfPhysicalPages
= 0; /* FIXME */
82 Sbi
->MmLowestPhysicalPage
= 0; /* FIXME */
83 Sbi
->MmHighestPhysicalPage
= 0; /* FIXME */
84 Sbi
->MmLowestUserAddress
= 0; /* FIXME */
85 Sbi
->MmLowestUserAddress1
= 0; /* FIXME */
86 Sbi
->MmHighestUserAddress
= 0; /* FIXME */
87 Sbi
->KeActiveProcessors
= 0x00000001; /* FIXME */
88 Sbi
->KeNumberProcessors
= 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
->KeProcessorArchitecture
= 0; /* FIXME */
110 Spi
->KeProcessorLevel
= 0; /* FIXME */
111 Spi
->KeProcessorRevision
= 0; /* FIXME */
113 Spi
->KeFeatureBits
= 0x00000000; /* FIXME */
115 return (STATUS_SUCCESS
);
118 /* Class 2 - Performance Information */
119 QSI_DEF(SystemPerformanceInfo
)
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
->TotalProcessorTime
.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
->MmAvailablePages
= 0; /* FIXME */
141 Spi
->MmTotalCommitedPages
= 0; /* FIXME */
142 Spi
->MmTotalCommitLimit
= 0; /* FIXME */
143 Spi
->MmPeakLimit
= 0; /* FIXME */
144 Spi
->PageFaults
= 0; /* FIXME */
145 Spi
->WriteCopies
= 0; /* FIXME */
146 Spi
->TransitionFaults
= 0; /* FIXME */
147 Spi
->Unknown1
= 0; /* FIXME */
148 Spi
->DemandZeroFaults
= 0; /* FIXME */
149 Spi
->PagesInput
= 0; /* FIXME */
150 Spi
->PagesRead
= 0; /* FIXME */
151 Spi
->Unknown2
= 0; /* FIXME */
152 Spi
->Unknown3
= 0; /* FIXME */
153 Spi
->PagesOutput
= 0; /* FIXME */
154 Spi
->PageWrites
= 0; /* FIXME */
155 Spi
->Unknown4
= 0; /* FIXME */
156 Spi
->Unknown5
= 0; /* FIXME */
157 Spi
->PoolPagedBytes
= 0; /* FIXME */
158 Spi
->PoolNonPagedBytes
= 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 Information */
212 QSI_DEF(SystemTimeInformation
)
214 PSYSTEM_TIME_INFORMATION Sti
215 = (PSYSTEM_TIME_INFORMATION
) Buffer
;
217 *ReqSize
= sizeof (SYSTEM_TIME_INFORMATION
);
219 * Check user buffer's size
221 if (Size
< sizeof (SYSTEM_TIME_INFORMATION
))
223 return (STATUS_INFO_LENGTH_MISMATCH
);
226 Sti
->KeBootTime
.QuadPart
= 0; /* FIXME */
227 Sti
->KeSystemTime
.QuadPart
= 0; /* FIXME */
228 Sti
->ExpTimeZoneBias
.QuadPart
= 0; /* FIXME */
229 Sti
->ExpTimeZoneId
= 0; /* FIXME */
230 Sti
->Unused
= 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 - SDT Information */
250 QSI_DEF(SystemServiceDescriptorTableInfo
)
253 return (STATUS_NOT_IMPLEMENTED
);
256 /* Class 7 - I/O Configuration Information */
257 QSI_DEF(SystemIoConfigInfo
)
260 return (STATUS_NOT_IMPLEMENTED
);
263 /* Class 8 - Processor Time Information */
264 QSI_DEF(SystemProcessorTimeInfo
)
267 return (STATUS_NOT_IMPLEMENTED
);
270 /* Class 9 - Global Flag Information */
271 QSI_DEF(SystemNtGlobalFlagInformation
)
273 if (sizeof (SYSTEM_GLOBAL_FLAG_INFO
) != Size
)
275 * ReqSize
= sizeof (SYSTEM_GLOBAL_FLAG_INFO
);
276 return (STATUS_INFO_LENGTH_MISMATCH
);
278 ((PSYSTEM_GLOBAL_FLAG_INFO
) Buffer
)->NtGlobalFlag
= NtGlobalFlag
;
279 return (STATUS_SUCCESS
);
282 SSI_DEF(SystemNtGlobalFlagInformation
)
284 if (sizeof (SYSTEM_GLOBAL_FLAG_INFO
) != Size
)
286 return (STATUS_INFO_LENGTH_MISMATCH
);
288 NtGlobalFlag
= ((PSYSTEM_GLOBAL_FLAG_INFO
) Buffer
)->NtGlobalFlag
;
289 return (STATUS_SUCCESS
);
292 /* Class 10 - ? Information */
293 QSI_DEF(SystemInformation10
)
296 return (STATUS_NOT_IMPLEMENTED
);
299 /* Class 11 - Modules Information */
300 QSI_DEF(SystemModuleInfo
)
303 return (STATUS_NOT_IMPLEMENTED
);
306 /* Class 12 - Resource Lock Information */
307 QSI_DEF(SystemResourceLockInfo
)
310 return (STATUS_NOT_IMPLEMENTED
);
313 /* Class 13 - ? Information */
314 QSI_DEF(SystemInformation13
)
317 return (STATUS_NOT_IMPLEMENTED
);
320 /* Class 14 - ? Information */
321 QSI_DEF(SystemInformation14
)
324 return (STATUS_NOT_IMPLEMENTED
);
327 /* Class 15 - ? Information */
328 QSI_DEF(SystemInformation15
)
331 return (STATUS_NOT_IMPLEMENTED
);
334 /* Class 16 - Handle Information */
335 QSI_DEF(SystemHandleInfo
)
338 return (STATUS_NOT_IMPLEMENTED
);
341 /* Class 17 - Information */
342 QSI_DEF(SystemObjectInformation
)
345 return (STATUS_NOT_IMPLEMENTED
);
348 /* Class 18 - Information */
349 QSI_DEF(SystemPageFileInformation
)
352 return (STATUS_NOT_IMPLEMENTED
);
355 /* Class 19 - Information */
356 QSI_DEF(SystemInstructionEmulationInfo
)
359 return (STATUS_NOT_IMPLEMENTED
);
362 /* Class 20 - ? Information */
363 QSI_DEF(SystemInformation20
)
366 return (STATUS_NOT_IMPLEMENTED
);
369 /* Class 21 - Information */
370 QSI_DEF(SystemCacheInformation
)
372 if (Size
< sizeof (SYSTEM_CACHE_INFORMATION
))
374 * ReqSize
= sizeof (SYSTEM_CACHE_INFORMATION
);
375 return (STATUS_INFO_LENGTH_MISMATCH
);
378 return (STATUS_NOT_IMPLEMENTED
);
381 SSI_DEF(SystemCacheInformation
)
383 if (Size
< sizeof (SYSTEM_CACHE_INFORMATION
))
385 return (STATUS_INFO_LENGTH_MISMATCH
);
388 return (STATUS_NOT_IMPLEMENTED
);
391 /* Class 22 - Pool Tag Information */
392 QSI_DEF(SystemPoolTagInformation
)
395 return (STATUS_NOT_IMPLEMENTED
);
398 /* Class 23 - Processor Schedule Information */
399 QSI_DEF(SystemProcessorScheduleInfo
)
402 return (STATUS_NOT_IMPLEMENTED
);
405 /* Class 24 - DPC Information */
406 QSI_DEF(SystemDpcInformation
)
409 return (STATUS_NOT_IMPLEMENTED
);
412 SSI_DEF(SystemDpcInformation
)
415 return (STATUS_NOT_IMPLEMENTED
);
418 /* Class 25 - ? Information */
419 QSI_DEF(SystemInformation25
)
422 return (STATUS_NOT_IMPLEMENTED
);
425 /* Class 26 - Load Gdi Driver Information */
426 SSI_DEF(SystemLoadGdiDriverInformation
)
428 PSYSTEM_GDI_DRIVER_INFORMATION Sdi
429 = (PSYSTEM_GDI_DRIVER_INFORMATION
) Buffer
;
431 if (sizeof (SYSTEM_GDI_DRIVER_INFORMATION
) != Size
)
433 return (STATUS_INFO_LENGTH_MISMATCH
);
436 return LdrLoadGdiDriver (&Sdi
->DriverName
,
438 &Sdi
->SectionPointer
,
440 &Sdi
->ExportSectionPointer
);
443 /* Class 27 - Unload Gdi Driver Information */
444 SSI_DEF(SystemUnloadGdiDriverInformation
)
447 return (STATUS_NOT_IMPLEMENTED
);
450 /* Class 28 - Information */
451 QSI_DEF(SystemTimeAdjustmentInformation
)
453 if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
) > Size
)
455 * ReqSize
= sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
);
456 return (STATUS_INFO_LENGTH_MISMATCH
);
459 return (STATUS_NOT_IMPLEMENTED
);
462 SSI_DEF(SystemTimeAdjustmentInformation
)
464 if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO
) > Size
)
466 return (STATUS_INFO_LENGTH_MISMATCH
);
469 return (STATUS_NOT_IMPLEMENTED
);
472 /* Class 29 - ? Information */
473 QSI_DEF(SystemInformation29
)
476 return (STATUS_NOT_IMPLEMENTED
);
479 /* Class 30 - ? Information */
480 QSI_DEF(SystemInformation30
)
483 return (STATUS_NOT_IMPLEMENTED
);
486 /* Class 31 - ? Information */
487 QSI_DEF(SystemInformation31
)
490 return (STATUS_NOT_IMPLEMENTED
);
493 /* Class 32 - Crach Dump Information */
494 QSI_DEF(SystemCrashDumpSectionInfo
)
497 return (STATUS_NOT_IMPLEMENTED
);
500 /* Class 33 - Processor Fault Information */
501 QSI_DEF(SystemProcessorFaultCountInfo
)
504 return (STATUS_NOT_IMPLEMENTED
);
507 /* Class 34 - Crach Dump State Information */
508 QSI_DEF(SystemCrashDumpStateInfo
)
511 return (STATUS_NOT_IMPLEMENTED
);
514 /* Class 35 - Debugger Information */
515 QSI_DEF(SystemDebuggerInfo
)
518 return (STATUS_NOT_IMPLEMENTED
);
521 /* Class 36 - Thread Switch Counters Information */
522 QSI_DEF(SystemThreadSwitchCountersInfo
)
525 return (STATUS_NOT_IMPLEMENTED
);
528 /* Class 37 - Quota Information */
529 QSI_DEF(SystemQuotaInformation
)
532 return (STATUS_NOT_IMPLEMENTED
);
535 SSI_DEF(SystemQuotaInformation
)
538 return (STATUS_NOT_IMPLEMENTED
);
541 /* Class 38 - Load Driver Information */
542 SSI_DEF(SystemLoadDriverInfo
)
545 return (STATUS_NOT_IMPLEMENTED
);
548 /* Class 39 - Priority Separation Information */
549 SSI_DEF(SystemPrioritySeparationInfo
)
552 return (STATUS_NOT_IMPLEMENTED
);
555 /* Class 40 - ? Information */
556 QSI_DEF(SystemInformation40
)
559 return (STATUS_NOT_IMPLEMENTED
);
562 /* Class 41 - ? Information */
563 QSI_DEF(SystemInformation41
)
566 return (STATUS_NOT_IMPLEMENTED
);
569 /* Class 42 - ? Information */
570 QSI_DEF(SystemInformation42
)
573 return (STATUS_NOT_IMPLEMENTED
);
576 /* Class 43 - ? Information */
577 QSI_DEF(SystemInformation43
)
580 return (STATUS_NOT_IMPLEMENTED
);
583 /* Class 44 - Information */
584 QSI_DEF(SystemTimeZoneInformation
)
586 * ReqSize
= sizeof (TIME_ZONE_INFORMATION
);
588 if (sizeof (TIME_ZONE_INFORMATION
) != Size
)
590 return (STATUS_INFO_LENGTH_MISMATCH
);
592 /* Copy the time zone information struct */
595 & SystemTimeZoneInfo
,
596 sizeof (TIME_ZONE_INFORMATION
)
599 return (STATUS_SUCCESS
);
603 SSI_DEF(SystemTimeZoneInformation
)
606 * Check user buffer's size
608 if (Size
< sizeof (TIME_ZONE_INFORMATION
))
610 return (STATUS_INFO_LENGTH_MISMATCH
);
612 /* Copy the time zone information struct */
614 & SystemTimeZoneInfo
,
615 (TIME_ZONE_INFORMATION
*) Buffer
,
616 sizeof (TIME_ZONE_INFORMATION
)
618 return (STATUS_SUCCESS
);
622 /* Class 45 - Information */
623 QSI_DEF(SystemLookasideInformation
)
626 return (STATUS_NOT_IMPLEMENTED
);
630 /* Query/Set Calls Table */
634 NTSTATUS (* Query
) (PVOID
,ULONG
,PULONG
);
635 NTSTATUS (* Set
) (PVOID
,ULONG
);
642 // XX unknown behaviour
644 #define SI_QS(n) {QSI_USE(n),SSI_USE(n)}
645 #define SI_QX(n) {QSI_USE(n),NULL}
646 #define SI_XS(n) {NULL,SSI_USE(n)}
647 #define SI_XX(n) {NULL,NULL}
653 SI_QX(SystemBasicInformation
),
654 SI_QX(SystemProcessorInformation
),
655 SI_QX(SystemPerformanceInfo
),
656 SI_QX(SystemTimeInformation
),
657 SI_QX(SystemPathInformation
), /* should be SI_XX */
658 SI_QX(SystemProcessInformation
),
659 SI_QX(SystemServiceDescriptorTableInfo
),
660 SI_QX(SystemIoConfigInfo
),
661 SI_QX(SystemProcessorTimeInfo
),
662 SI_QS(SystemNtGlobalFlagInformation
),
663 SI_QX(SystemInformation10
), /* should be SI_XX */
664 SI_QX(SystemModuleInfo
),
665 SI_QX(SystemResourceLockInfo
),
666 SI_QX(SystemInformation13
), /* should be SI_XX */
667 SI_QX(SystemInformation14
), /* should be SI_XX */
668 SI_QX(SystemInformation15
), /* should be SI_XX */
669 SI_QX(SystemHandleInfo
),
670 SI_QX(SystemObjectInformation
),
671 SI_QX(SystemPageFileInformation
),
672 SI_QX(SystemInstructionEmulationInfo
),
673 SI_QX(SystemInformation20
), /* it should be SI_XX */
674 SI_QS(SystemCacheInformation
),
675 SI_QX(SystemPoolTagInformation
),
676 SI_QX(SystemProcessorScheduleInfo
),
677 SI_QS(SystemDpcInformation
),
678 SI_QX(SystemInformation25
), /* it should be SI_XX */
679 SI_XS(SystemLoadGdiDriverInformation
),
680 SI_XS(SystemUnloadGdiDriverInformation
),
681 SI_QS(SystemTimeAdjustmentInformation
),
682 SI_QX(SystemInformation29
), /* it should be SI_XX */
683 SI_QX(SystemInformation30
), /* it should be SI_XX */
684 SI_QX(SystemInformation31
), /* it should be SI_XX */
685 SI_QX(SystemCrashDumpSectionInfo
),
686 SI_QX(SystemProcessorFaultCountInfo
),
687 SI_QX(SystemCrashDumpStateInfo
),
688 SI_QX(SystemDebuggerInfo
),
689 SI_QX(SystemThreadSwitchCountersInfo
),
690 SI_QS(SystemQuotaInformation
),
691 SI_XS(SystemLoadDriverInfo
),
692 SI_XS(SystemPrioritySeparationInfo
),
693 SI_QX(SystemInformation40
), /* it should be SI_XX */
694 SI_QX(SystemInformation41
), /* it should be SI_XX */
695 SI_QX(SystemInformation42
), /* it should be SI_XX */
696 SI_QX(SystemInformation43
), /* it should be SI_XX */
697 SI_QS(SystemTimeZoneInformation
), /* it should be SI_QX */
698 SI_QX(SystemLookasideInformation
)
704 NtQuerySystemInformation (
705 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
706 OUT PVOID SystemInformation
,
708 OUT PULONG ResultLength
712 * If called from user mode, check
713 * possible unsafe arguments.
716 if (KernelMode
!= KeGetPreviousMode())
720 // SystemInformation,
730 * Clear the user buffer.
732 RtlZeroMemory (SystemInformation
, Length
);
734 * Check the request is valid.
736 if ( (SystemInformationClass
>= SystemInformationClassMin
)
737 && (SystemInformationClass
< SystemInformationClassMax
)
740 if (NULL
!= CallQS
[SystemInformationClass
].Query
)
743 * Hand the request to a subhandler.
745 return CallQS
[SystemInformationClass
].Query (
752 return (STATUS_INVALID_INFO_CLASS
);
758 NtSetSystemInformation (
759 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
760 IN PVOID SystemInformation
,
761 IN ULONG SystemInformationLength
765 * If called from user mode, check
766 * possible unsafe arguments.
769 if (KernelMode
!= KeGetPreviousMode())
773 // SystemInformation,
783 * Check the request is valid.
785 if ( (SystemInformationClass
>= SystemInformationClassMin
)
786 && (SystemInformationClass
< SystemInformationClassMax
)
789 if (NULL
!= CallQS
[SystemInformationClass
].Set
)
792 * Hand the request to a subhandler.
794 return CallQS
[SystemInformationClass
].Set (
796 SystemInformationLength
800 return (STATUS_INVALID_INFO_CLASS
);
806 NtFlushInstructionCache (
807 IN HANDLE ProcessHandle
,
808 IN PVOID BaseAddress
,
809 IN UINT NumberOfBytesToFlush