ReactOS 0.4.16-dev-838-g27bb510
sysinfo.c File Reference
#include <ntoskrnl.h>
#include <wmidata.h>
#include <wmistr.h>
#include <debug.h>
Include dependency graph for sysinfo.c:

Go to the source code of this file.

Classes

struct  _QSSI_CALLS
 

Macros

#define NDEBUG
 
#define MAX_ENVVAL_SIZE   1024
 
#define SIG_ACPI   0x41435049
 
#define SIG_FIRM   0x4649524D
 
#define SIG_RSMB   0x52534D42
 
#define QSI_USE(n)   QSI##n
 
#define QSI_DEF(n)   static NTSTATUS QSI_USE(n) (PVOID Buffer, ULONG Size, PULONG ReqSize)
 
#define SSI_USE(n)   SSI##n
 
#define SSI_DEF(n)   static NTSTATUS SSI_USE(n) (PVOID Buffer, ULONG Size)
 
#define SI_QS(n)   {QSI_USE(n),SSI_USE(n)}
 
#define SI_QX(n)   {QSI_USE(n),NULL}
 
#define SI_XS(n)   {NULL,SSI_USE(n)}
 
#define SI_XX(n)   {NULL,NULL}
 
#define MIN_SYSTEM_INFO_CLASS   (SystemBasicInformation)
 
#define MAX_SYSTEM_INFO_CLASS   RTL_NUMBER_OF(CallQS)
 

Typedefs

typedef struct _QSSI_CALLS QSSI_CALLS
 

Functions

FORCEINLINE NTSTATUS ExpConvertLdrModuleToRtlModule (IN ULONG ModuleCount, IN PLDR_DATA_TABLE_ENTRY LdrEntry, OUT PRTL_PROCESS_MODULE_INFORMATION ModuleInfo)
 
NTSTATUS NTAPI ExpQueryModuleInformation (IN PLIST_ENTRY KernelModeList, IN PLIST_ENTRY UserModeList, OUT PRTL_PROCESS_MODULES Modules, IN ULONG Length, OUT PULONG ReturnLength)
 
VOID NTAPI ExUnlockUserBuffer (PMDL Mdl)
 
NTSTATUS NTAPI ExLockUserBuffer (PVOID BaseAddress, ULONG Length, KPROCESSOR_MODE AccessMode, LOCK_OPERATION Operation, PVOID *MappedSystemVa, PMDL *OutMdl)
 
NTSTATUS NTAPI ExpGetRawSMBiosTable (_Out_opt_ PVOID Buffer, _Out_ ULONG *OutSize, _In_ ULONG BufferSize)
 
VOID NTAPI ExGetCurrentProcessorCpuUsage (PULONG CpuUsage)
 
VOID NTAPI ExGetCurrentProcessorCounts (PULONG IdleTime, PULONG KernelAndUserTime, PULONG ProcessorNumber)
 
BOOLEAN NTAPI ExIsProcessorFeaturePresent (IN ULONG ProcessorFeature)
 
BOOLEAN NTAPI ExVerifySuite (SUITE_TYPE SuiteType)
 
NTSTATUS NTAPI NtQuerySystemEnvironmentValue (IN PUNICODE_STRING VariableName, OUT PWSTR ValueBuffer, IN ULONG ValueBufferLength, IN OUT PULONG ReturnLength OPTIONAL)
 
NTSTATUS NTAPI NtSetSystemEnvironmentValue (IN PUNICODE_STRING VariableName, IN PUNICODE_STRING Value)
 
NTSTATUS NTAPI NtEnumerateSystemEnvironmentValuesEx (IN ULONG InformationClass, IN PVOID Buffer, IN ULONG BufferLength)
 
NTSTATUS NTAPI NtQuerySystemEnvironmentValueEx (_In_ PUNICODE_STRING VariableName, _In_ LPGUID VendorGuid, _Out_opt_ PVOID Value, _Inout_ PULONG ReturnLength, _Out_opt_ PULONG Attributes)
 
NTSTATUS NTAPI NtSetSystemEnvironmentValueEx (_In_ PUNICODE_STRING VariableName, _In_ LPGUID VendorGuid, _In_reads_bytes_opt_(ValueLength) PVOID Value, _In_ ULONG ValueLength, _In_ ULONG Attributes)
 
VOID NTAPI ExQueryPoolUsage (OUT PULONG PagedPoolPages, OUT PULONG NonPagedPoolPages, OUT PULONG PagedPoolAllocs, OUT PULONG PagedPoolFrees, OUT PULONG PagedPoolLookasideHits, OUT PULONG NonPagedPoolAllocs, OUT PULONG NonPagedPoolFrees, OUT PULONG NonPagedPoolLookasideHits)
 
 QSI_DEF (SystemBasicInformation)
 
 QSI_DEF (SystemProcessorInformation)
 
 QSI_DEF (SystemPerformanceInformation)
 
 QSI_DEF (SystemTimeOfDayInformation)
 
 QSI_DEF (SystemPathInformation)
 
 QSI_DEF (SystemProcessInformation)
 
 QSI_DEF (SystemCallCountInformation)
 
 QSI_DEF (SystemDeviceInformation)
 
 QSI_DEF (SystemProcessorPerformanceInformation)
 
 QSI_DEF (SystemFlagsInformation)
 
 SSI_DEF (SystemFlagsInformation)
 
 QSI_DEF (SystemCallTimeInformation)
 
 QSI_DEF (SystemModuleInformation)
 
 QSI_DEF (SystemLocksInformation)
 
 QSI_DEF (SystemStackTraceInformation)
 
 QSI_DEF (SystemPagedPoolInformation)
 
 QSI_DEF (SystemNonPagedPoolInformation)
 
 QSI_DEF (SystemHandleInformation)
 
 QSI_DEF (SystemObjectInformation)
 
 QSI_DEF (SystemPageFileInformation)
 
 QSI_DEF (SystemVdmInstemulInformation)
 
 QSI_DEF (SystemVdmBopInformation)
 
 QSI_DEF (SystemFileCacheInformation)
 
 SSI_DEF (SystemFileCacheInformation)
 
 QSI_DEF (SystemPoolTagInformation)
 
 QSI_DEF (SystemInterruptInformation)
 
 QSI_DEF (SystemDpcBehaviourInformation)
 
 SSI_DEF (SystemDpcBehaviourInformation)
 
 QSI_DEF (SystemFullMemoryInformation)
 
 SSI_DEF (SystemLoadGdiDriverInformation)
 
 SSI_DEF (SystemUnloadGdiDriverInformation)
 
 QSI_DEF (SystemTimeAdjustmentInformation)
 
 SSI_DEF (SystemTimeAdjustmentInformation)
 
 QSI_DEF (SystemSummaryMemoryInformation)
 
 QSI_DEF (SystemNextEventIdInformation)
 
 QSI_DEF (SystemPerformanceTraceInformation)
 
 QSI_DEF (SystemCrashDumpInformation)
 
 QSI_DEF (SystemExceptionInformation)
 
 QSI_DEF (SystemCrashDumpStateInformation)
 
 QSI_DEF (SystemKernelDebuggerInformation)
 
 QSI_DEF (SystemContextSwitchInformation)
 
 QSI_DEF (SystemRegistryQuotaInformation)
 
 SSI_DEF (SystemRegistryQuotaInformation)
 
 SSI_DEF (SystemExtendServiceTableInformation)
 
 SSI_DEF (SystemPrioritySeperation)
 
 QSI_DEF (SystemVerifierAddDriverInformation)
 
 QSI_DEF (SystemVerifierRemoveDriverInformation)
 
 QSI_DEF (SystemProcessorIdleInformation)
 
 QSI_DEF (SystemLegacyDriverInformation)
 
 QSI_DEF (SystemCurrentTimeZoneInformation)
 
 SSI_DEF (SystemCurrentTimeZoneInformation)
 
static VOID ExpCopyLookasideInformation (PSYSTEM_LOOKASIDE_INFORMATION *InfoPointer, PULONG RemainingPointer, PLIST_ENTRY ListHead, BOOLEAN ListUsesMisses)
 
 QSI_DEF (SystemLookasideInformation)
 
 SSI_DEF (SystemTimeSlipNotification)
 
NTSTATUS NTAPI MmSessionCreate (OUT PULONG SessionId)
 
NTSTATUS NTAPI MmSessionDelete (IN ULONG SessionId)
 
 SSI_DEF (SystemSessionCreate)
 
 SSI_DEF (SystemSessionDetach)
 
 QSI_DEF (SystemSessionInformation)
 
 QSI_DEF (SystemRangeStartInformation)
 
 QSI_DEF (SystemVerifierInformation)
 
 SSI_DEF (SystemVerifierInformation)
 
 SSI_DEF (SystemVerifierThunkExtend)
 
 QSI_DEF (SystemSessionProcessesInformation)
 
 SSI_DEF (SystemLoadGdiDriverInSystemSpaceInformation)
 
 QSI_DEF (SystemNumaProcessorMap)
 
 QSI_DEF (SystemPrefetcherInformation)
 
 QSI_DEF (SystemExtendedProcessInformation)
 
 QSI_DEF (SystemRecommendedSharedDataAlignment)
 
 QSI_DEF (SystemNumaAvailableMemory)
 
 QSI_DEF (SystemExtendedHandleInformation)
 
 QSI_DEF (SystemObjectSecurityMode)
 
 QSI_DEF (SystemLogicalProcessorInformation)
 
 QSI_DEF (SystemFirmwareTableInformation)
 
 C_ASSERT (SystemBasicInformation==0)
 
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation (_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG SystemInformationLength, _Out_opt_ PULONG ReturnLength)
 
__kernel_entry NTSTATUS NTAPI NtSetSystemInformation (_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _In_reads_bytes_(SystemInformationLength) PVOID SystemInformation, _In_ ULONG SystemInformationLength)
 
ULONG NTAPI NtGetCurrentProcessorNumber (VOID)
 
KPROCESSOR_MODE NTAPI ExGetPreviousMode (VOID)
 

Variables

LIST_ENTRY HandleTableListHead
 
EX_PUSH_LOCK HandleTableListLock
 
FAST_MUTEX ExpEnvironmentLock
 
ERESOURCE ExpFirmwareTableResource
 
LIST_ENTRY ExpFirmwareTableProviderListHead
 
static QSSI_CALLS CallQS []
 

Macro Definition Documentation

◆ MAX_ENVVAL_SIZE

#define MAX_ENVVAL_SIZE   1024

Definition at line 20 of file sysinfo.c.

◆ MAX_SYSTEM_INFO_CLASS

#define MAX_SYSTEM_INFO_CLASS   RTL_NUMBER_OF(CallQS)

Definition at line 2929 of file sysinfo.c.

◆ MIN_SYSTEM_INFO_CLASS

#define MIN_SYSTEM_INFO_CLASS   (SystemBasicInformation)

Definition at line 2928 of file sysinfo.c.

◆ NDEBUG

#define NDEBUG

Definition at line 16 of file sysinfo.c.

◆ QSI_DEF

#define QSI_DEF (   n)    static NTSTATUS QSI_USE(n) (PVOID Buffer, ULONG Size, PULONG ReqSize)

Definition at line 598 of file sysinfo.c.

◆ QSI_USE

#define QSI_USE (   n)    QSI##n

Definition at line 597 of file sysinfo.c.

◆ SI_QS

#define SI_QS (   n)    {QSI_USE(n),SSI_USE(n)}

Definition at line 2839 of file sysinfo.c.

◆ SI_QX

#define SI_QX (   n)    {QSI_USE(n),NULL}

Definition at line 2840 of file sysinfo.c.

◆ SI_XS

#define SI_XS (   n)    {NULL,SSI_USE(n)}

Definition at line 2841 of file sysinfo.c.

◆ SI_XX

#define SI_XX (   n)    {NULL,NULL}

Definition at line 2842 of file sysinfo.c.

◆ SIG_ACPI

#define SIG_ACPI   0x41435049

Definition at line 22 of file sysinfo.c.

◆ SIG_FIRM

#define SIG_FIRM   0x4649524D

Definition at line 23 of file sysinfo.c.

◆ SIG_RSMB

#define SIG_RSMB   0x52534D42

Definition at line 24 of file sysinfo.c.

◆ SSI_DEF

#define SSI_DEF (   n)    static NTSTATUS SSI_USE(n) (PVOID Buffer, ULONG Size)

Definition at line 602 of file sysinfo.c.

◆ SSI_USE

#define SSI_USE (   n)    SSI##n

Definition at line 601 of file sysinfo.c.

Typedef Documentation

◆ QSSI_CALLS

Function Documentation

◆ C_ASSERT()

C_ASSERT ( SystemBasicInformation  = =0)

◆ ExGetCurrentProcessorCounts()

VOID NTAPI ExGetCurrentProcessorCounts ( PULONG  IdleTime,
PULONG  KernelAndUserTime,
PULONG  ProcessorNumber 
)

Definition at line 345 of file sysinfo.c.

348{
349 PKPRCB Prcb;
350
351 Prcb = KeGetCurrentPrcb();
352
353 *IdleTime = Prcb->IdleThread->KernelTime;
354 *KernelAndUserTime = Prcb->KernelTime + Prcb->UserTime;
355 *ProcessorNumber = (ULONG)Prcb->Number;
356}
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1182
struct _KTHREAD * IdleThread
Definition: ketypes.h:661
ULONG UserTime
Definition: ketypes.h:827
USHORT Number
Definition: ketypes.h:652
ULONG KernelTime
Definition: ketypes.h:826
uint32_t ULONG
Definition: typedefs.h:59

Referenced by NdisGetCurrentProcessorCounts().

◆ ExGetCurrentProcessorCpuUsage()

VOID NTAPI ExGetCurrentProcessorCpuUsage ( PULONG  CpuUsage)

Definition at line 324 of file sysinfo.c.

325{
326 PKPRCB Prcb;
327 ULONG TotalTime;
328 ULONGLONG ScaledIdle;
329
330 Prcb = KeGetCurrentPrcb();
331
332 ScaledIdle = (ULONGLONG)Prcb->IdleThread->KernelTime * 100;
333 TotalTime = Prcb->KernelTime + Prcb->UserTime;
334 if (TotalTime != 0)
335 *CpuUsage = (ULONG)(100 - (ScaledIdle / TotalTime));
336 else
337 *CpuUsage = 0;
338}
if(dx< 0)
Definition: linetemp.h:194
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by NdisGetCurrentProcessorCpuUsage().

◆ ExGetPreviousMode()

KPROCESSOR_MODE NTAPI ExGetPreviousMode ( VOID  )

Definition at line 3070 of file sysinfo.c.

3071{
3072 /* Just use Ke */
3073 return KeGetPreviousMode();
3074}
#define KeGetPreviousMode()
Definition: ketypes.h:1115

◆ ExIsProcessorFeaturePresent()

BOOLEAN NTAPI ExIsProcessorFeaturePresent ( IN ULONG  ProcessorFeature)

Definition at line 363 of file sysinfo.c.

364{
365 /* Quick check to see if it exists at all */
366 if (ProcessorFeature >= PROCESSOR_FEATURE_MAX) return(FALSE);
367
368 /* Return our support for it */
369 return(SharedUserData->ProcessorFeatures[ProcessorFeature]);
370}
#define FALSE
Definition: types.h:117
#define SharedUserData
#define PROCESSOR_FEATURE_MAX

Referenced by KsecReadMachineSpecificCounters(), PciApplyHacks(), PciQueryRequirements(), and START_TEST().

◆ ExLockUserBuffer()

NTSTATUS NTAPI ExLockUserBuffer ( PVOID  BaseAddress,
ULONG  Length,
KPROCESSOR_MODE  AccessMode,
LOCK_OPERATION  Operation,
PVOID MappedSystemVa,
PMDL OutMdl 
)

Definition at line 202 of file sysinfo.c.

209{
210 PMDL Mdl;
212
213 *MappedSystemVa = NULL;
214 *OutMdl = NULL;
215
216 /* Allocate an MDL for the buffer */
218 if (Mdl == NULL)
219 {
221 }
222
223 /* Enter SEH for probing */
225 {
227 }
229 {
232 }
233 _SEH2_END;
234
235 /* Return the safe kernel mode buffer */
237 if (*MappedSystemVa == NULL)
238 {
241 }
242
243 /* Return the MDL */
244 *OutMdl = Mdl;
245 return STATUS_SUCCESS;
246}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
FP_OP Operation
Definition: fpcontrol.c:150
#define IoAllocateMdl
Definition: fxmdl.h:88
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:931
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
@ NormalPagePriority
Definition: imports.h:54
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
VOID NTAPI ExUnlockUserBuffer(PMDL Mdl)
Definition: sysinfo.c:194
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TAG_MDL
Definition: tag.h:88
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396

Referenced by KdSystemDebugControl(), and QSI_DEF().

◆ ExpConvertLdrModuleToRtlModule()

FORCEINLINE NTSTATUS ExpConvertLdrModuleToRtlModule ( IN ULONG  ModuleCount,
IN PLDR_DATA_TABLE_ENTRY  LdrEntry,
OUT PRTL_PROCESS_MODULE_INFORMATION  ModuleInfo 
)

Definition at line 35 of file sysinfo.c.

38{
39 PCHAR p;
42
43 /* Fill it out */
44 ModuleInfo->MappedBase = NULL;
45 ModuleInfo->ImageBase = LdrEntry->DllBase;
46 ModuleInfo->ImageSize = LdrEntry->SizeOfImage;
47 ModuleInfo->Flags = LdrEntry->Flags;
48 ModuleInfo->LoadCount = LdrEntry->LoadCount;
49 ModuleInfo->LoadOrderIndex = (USHORT)ModuleCount;
50 ModuleInfo->InitOrderIndex = 0;
51
52 /* Setup name */
53 RtlInitEmptyAnsiString(&ModuleName,
55 sizeof(ModuleInfo->FullPathName));
56
57 /* Convert it */
59 &LdrEntry->FullDllName,
60 FALSE);
62 {
63 /* Calculate offset to name */
64 p = ModuleName.Buffer + ModuleName.Length;
65 while ((p > ModuleName.Buffer) && (*--p))
66 {
67 /* Check if we found the separator */
69 {
70 /* We did, break out */
71 p++;
72 break;
73 }
74 }
75
76 /* Set the offset */
77 ModuleInfo->OffsetToFileName = (USHORT)(p - ModuleName.Buffer);
78 }
79 else
80 {
81 /* Return empty name */
83 ModuleInfo->OffsetToFileName = 0;
84 }
85
86 return Status;
87}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
_In_ ULONG _Out_writes_bytes_opt_ InformationLength PAUX_MODULE_EXTENDED_INFO ModuleInfo
Definition: aux_klib.h:65
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
GLfloat GLfloat p
Definition: glext.h:8902
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define ANSI_NULL
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
CHAR FullPathName[AUX_KLIB_MODULE_PATH_LEN]
Definition: aux_klib.h:41
ACPI_SIZE Length
Definition: actypes.h:1053
char * PCHAR
Definition: typedefs.h:51

Referenced by ExpQueryModuleInformation().

◆ ExpCopyLookasideInformation()

static VOID ExpCopyLookasideInformation ( PSYSTEM_LOOKASIDE_INFORMATION InfoPointer,
PULONG  RemainingPointer,
PLIST_ENTRY  ListHead,
BOOLEAN  ListUsesMisses 
)
static

Definition at line 2104 of file sysinfo.c.

2110{
2113 PLIST_ENTRY ListEntry;
2114 ULONG Remaining;
2115
2116 /* Get info pointer and remaining count of free array element */
2117 Info = *InfoPointer;
2118 Remaining = *RemainingPointer;
2119
2120 /* Loop as long as we have lookaside lists and free array elements */
2121 for (ListEntry = ListHead->Flink;
2122 (ListEntry != ListHead) && (Remaining > 0);
2123 ListEntry = ListEntry->Flink, Remaining--)
2124 {
2125 LookasideList = CONTAINING_RECORD(ListEntry, GENERAL_LOOKASIDE, ListEntry);
2126
2127 /* Fill the next array element */
2128 Info->CurrentDepth = LookasideList->Depth;
2129 Info->MaximumDepth = LookasideList->MaximumDepth;
2130 Info->TotalAllocates = LookasideList->TotalAllocates;
2131 Info->TotalFrees = LookasideList->TotalFrees;
2132 Info->Type = LookasideList->Type;
2133 Info->Tag = LookasideList->Tag;
2134 Info->Size = LookasideList->Size;
2135
2136 /* Check how the lists track misses/hits */
2137 if (ListUsesMisses)
2138 {
2139 /* Copy misses */
2140 Info->AllocateMisses = LookasideList->AllocateMisses;
2141 Info->FreeMisses = LookasideList->FreeMisses;
2142 }
2143 else
2144 {
2145 /* Calculate misses */
2146 Info->AllocateMisses = LookasideList->TotalAllocates
2147 - LookasideList->AllocateHits;
2148 Info->FreeMisses = LookasideList->TotalFrees
2149 - LookasideList->FreeHits;
2150 }
2151 }
2152
2153 /* Return the updated pointer and remaining count */
2154 *InfoPointer = Info;
2155 *RemainingPointer = Remaining;
2156}
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
Definition: fltkernel.h:2554
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE GENERAL_LOOKASIDE
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE * PGENERAL_LOOKASIDE

Referenced by QSI_DEF().

◆ ExpGetRawSMBiosTable()

NTSTATUS NTAPI ExpGetRawSMBiosTable ( _Out_opt_ PVOID  Buffer,
_Out_ ULONG OutSize,
_In_ ULONG  BufferSize 
)

Definition at line 250 of file sysinfo.c.

254{
256 PVOID DataBlockObject;
257 PWNODE_ALL_DATA AllData;
258 ULONG WMIBufSize;
259
260 ASSERT(OutSize != NULL);
261 *OutSize = 0;
262
263 /* Open the data block object for the SMBIOS table */
266 &DataBlockObject);
267 if (!NT_SUCCESS(Status))
268 {
269 DPRINT1("IoWMIOpenBlock failed: 0x%08lx\n", Status);
270 return Status;
271 }
272
273 /* Query the required buffer size */
274 WMIBufSize = 0;
275 Status = IoWMIQueryAllData(DataBlockObject, &WMIBufSize, NULL);
276 if (!NT_SUCCESS(Status))
277 {
278 DPRINT1("IoWMIOpenBlock failed: 0x%08lx\n", Status);
279 return Status;
280 }
281
282 AllData = ExAllocatePoolWithTag(PagedPool, WMIBufSize, 'itfS');
283 if (AllData == NULL)
284 {
285 DPRINT1("Failed to allocate %lu bytes for SMBIOS tables\n", WMIBufSize);
287 }
288
289 /* Query the buffer data */
290 Status = IoWMIQueryAllData(DataBlockObject, &WMIBufSize, AllData);
291 if (!NT_SUCCESS(Status))
292 {
293 DPRINT1("IoWMIOpenBlock failed: 0x%08lx\n", Status);
294 ExFreePoolWithTag(AllData, 'itfS');
295 return Status;
296 }
297
299 *OutSize = AllData->FixedInstanceSize;
300 if (Buffer != NULL)
301 {
302 if (BufferSize >= *OutSize)
303 {
304 RtlMoveMemory(Buffer, AllData + 1, *OutSize);
305 }
306 else
307 {
309 }
310 }
311
312 /* Free the buffer */
313 ExFreePoolWithTag(AllData, 'itfS');
314 return Status;
315}
#define DPRINT1
Definition: precomp.h:8
Definition: bufpool.h:45
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
const GUID MSSmBios_RawSMBiosTables_GUID
Definition: hwhacks.c:20
NTSTATUS NTAPI IoWMIOpenBlock(_In_ LPCGUID DataBlockGuid, _In_ ULONG DesiredAccess, _Out_ PVOID *DataBlockObject)
Definition: wmi.c:140
NTSTATUS NTAPI IoWMIQueryAllData(IN PVOID DataBlockObject, IN OUT ULONG *InOutBufferSize, OUT PVOID OutBuffer)
Definition: wmi.c:169
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
ULONG FixedInstanceSize
Definition: wmistr.h:118
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define WMIGUID_QUERY
Definition: wmistr.h:159

Referenced by QSI_DEF().

◆ ExpQueryModuleInformation()

NTSTATUS NTAPI ExpQueryModuleInformation ( IN PLIST_ENTRY  KernelModeList,
IN PLIST_ENTRY  UserModeList,
OUT PRTL_PROCESS_MODULES  Modules,
IN ULONG  Length,
OUT PULONG  ReturnLength 
)

Definition at line 91 of file sysinfo.c.

96{
100 PLDR_DATA_TABLE_ENTRY LdrEntry;
101 ULONG ModuleCount = 0;
102 PLIST_ENTRY NextEntry;
103
104 /* Setup defaults */
106 ModuleInfo = &Modules->Modules[0];
107
108 /* Loop the kernel list */
109 NextEntry = KernelModeList->Flink;
110 while (NextEntry != KernelModeList)
111 {
112 /* Get the entry */
113 LdrEntry = CONTAINING_RECORD(NextEntry,
115 InLoadOrderLinks);
116
117 /* Update size and check if we can manage one more entry */
119 if (Length >= RequiredLength)
120 {
122 LdrEntry,
123 ModuleInfo);
124
125 /* Go to the next module */
126 ModuleInfo++;
127 }
128 else
129 {
130 /* Set error code */
132 }
133
134 /* Update count and move to next entry */
135 ModuleCount++;
136 NextEntry = NextEntry->Flink;
137 }
138
139 /* Check if caller also wanted user modules */
140 if (UserModeList)
141 {
142 NextEntry = UserModeList->Flink;
143 while (NextEntry != UserModeList)
144 {
145 /* Get the entry */
146 LdrEntry = CONTAINING_RECORD(NextEntry,
148 InLoadOrderLinks);
149
150 /* Update size and check if we can manage one more entry */
152 if (Length >= RequiredLength)
153 {
155 LdrEntry,
156 ModuleInfo);
157
158 /* Go to the next module */
159 ModuleInfo++;
160 }
161 else
162 {
163 /* Set error code */
165 }
166
167 /* Update count and move to next entry */
168 ModuleCount++;
169 NextEntry = NextEntry->Flink;
170 }
171 }
172
173 /* Update return length */
175
176 /* Validate the length again */
177 if (Length >= FIELD_OFFSET(RTL_PROCESS_MODULES, Modules))
178 {
179 /* Set the final count */
180 Modules->NumberOfModules = ModuleCount;
181 }
182 else
183 {
184 /* Otherwise, we failed */
186 }
187
188 /* Done */
189 return Status;
190}
_In_ PVOID _In_ ULONG _Out_ PVOID _In_ ULONG _Inout_ PULONG ReturnLength
struct _RTL_PROCESS_MODULE_INFORMATION RTL_PROCESS_MODULE_INFORMATION
FORCEINLINE NTSTATUS ExpConvertLdrModuleToRtlModule(IN ULONG ModuleCount, IN PLDR_DATA_TABLE_ENTRY LdrEntry, OUT PRTL_PROCESS_MODULE_INFORMATION ModuleInfo)
Definition: sysinfo.c:35
Definition: btrfs_drv.h:1876
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:30

Referenced by QSI_DEF().

◆ ExQueryPoolUsage()

VOID NTAPI ExQueryPoolUsage ( OUT PULONG  PagedPoolPages,
OUT PULONG  NonPagedPoolPages,
OUT PULONG  PagedPoolAllocs,
OUT PULONG  PagedPoolFrees,
OUT PULONG  PagedPoolLookasideHits,
OUT PULONG  NonPagedPoolAllocs,
OUT PULONG  NonPagedPoolFrees,
OUT PULONG  NonPagedPoolLookasideHits 
)

Definition at line 1768 of file expool.c.

1776{
1777 ULONG i;
1778 PPOOL_DESCRIPTOR PoolDesc;
1779
1780 //
1781 // Assume all failures
1782 //
1783 *PagedPoolPages = 0;
1784 *PagedPoolAllocs = 0;
1785 *PagedPoolFrees = 0;
1786
1787 //
1788 // Tally up the totals for all the apged pool
1789 //
1790 for (i = 0; i < ExpNumberOfPagedPools + 1; i++)
1791 {
1792 PoolDesc = ExpPagedPoolDescriptor[i];
1793 *PagedPoolPages += PoolDesc->TotalPages + PoolDesc->TotalBigPages;
1794 *PagedPoolAllocs += PoolDesc->RunningAllocs;
1795 *PagedPoolFrees += PoolDesc->RunningDeAllocs;
1796 }
1797
1798 //
1799 // The first non-paged pool has a hardcoded well-known descriptor name
1800 //
1801 PoolDesc = &NonPagedPoolDescriptor;
1802 *NonPagedPoolPages = PoolDesc->TotalPages + PoolDesc->TotalBigPages;
1803 *NonPagedPoolAllocs = PoolDesc->RunningAllocs;
1804 *NonPagedPoolFrees = PoolDesc->RunningDeAllocs;
1805
1806 //
1807 // If the system has more than one non-paged pool, copy the other descriptor
1808 // totals as well
1809 //
1810#if 0
1811 if (ExpNumberOfNonPagedPools > 1)
1812 {
1813 for (i = 0; i < ExpNumberOfNonPagedPools; i++)
1814 {
1815 PoolDesc = ExpNonPagedPoolDescriptor[i];
1816 *NonPagedPoolPages += PoolDesc->TotalPages + PoolDesc->TotalBigPages;
1817 *NonPagedPoolAllocs += PoolDesc->RunningAllocs;
1818 *NonPagedPoolFrees += PoolDesc->RunningDeAllocs;
1819 }
1820 }
1821#endif
1822
1823 //
1824 // Get the amount of hits in the system lookaside lists
1825 //
1827 {
1828 PLIST_ENTRY ListEntry;
1829
1830 for (ListEntry = ExPoolLookasideListHead.Flink;
1831 ListEntry != &ExPoolLookasideListHead;
1832 ListEntry = ListEntry->Flink)
1833 {
1835
1836 Lookaside = CONTAINING_RECORD(ListEntry, GENERAL_LOOKASIDE, ListEntry);
1837
1838 if (Lookaside->Type == NonPagedPool)
1839 {
1840 *NonPagedPoolLookasideHits += Lookaside->AllocateHits;
1841 }
1842 else
1843 {
1844 *PagedPoolLookasideHits += Lookaside->AllocateHits;
1845 }
1846 }
1847 }
1848}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define NonPagedPool
Definition: env_spec_w32.h:307
ULONG ExpNumberOfPagedPools
Definition: expool.c:41
POOL_DESCRIPTOR NonPagedPoolDescriptor
Definition: expool.c:42
PPOOL_DESCRIPTOR ExpPagedPoolDescriptor[16+1]
Definition: expool.c:43
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LIST_ENTRY ExPoolLookasideListHead
Definition: lookas.c:22
ULONG RunningAllocs
Definition: miarm.h:327
ULONG TotalPages
Definition: miarm.h:329
ULONG RunningDeAllocs
Definition: miarm.h:328
ULONG TotalBigPages
Definition: miarm.h:330
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414

Referenced by QSI_DEF().

◆ ExUnlockUserBuffer()

VOID NTAPI ExUnlockUserBuffer ( PMDL  Mdl)

Definition at line 194 of file sysinfo.c.

195{
198}
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1435

Referenced by ExLockUserBuffer(), KdSystemDebugControl(), and QSI_DEF().

◆ ExVerifySuite()

BOOLEAN NTAPI ExVerifySuite ( SUITE_TYPE  SuiteType)

Definition at line 377 of file sysinfo.c.

378{
379 if (SuiteType == Personal) return TRUE;
380 return FALSE;
381}
@ Personal
Definition: extypes.h:29

Referenced by DisplayBootBitmap(), and InitializeMachineInformation().

◆ MmSessionCreate()

NTSTATUS NTAPI MmSessionCreate ( OUT PULONG  SessionId)

Definition at line 827 of file session.c.

828{
830 ULONG SessionLeaderExists;
832
833 /* Fail if the process is already in a session */
835 {
836 DPRINT1("Process already in session\n");
838 }
839
840 /* Check if the process is already the session leader */
841 if (!Process->Vm.Flags.SessionLeader)
842 {
843 /* Atomically set it as the leader */
844 SessionLeaderExists = InterlockedCompareExchange(&MiSessionLeaderExists, 1, 0);
845 if (SessionLeaderExists)
846 {
847 DPRINT1("Session leader race\n");
849 }
850
851 /* Do the work required to upgrade him */
853 }
854
855 /* Create the session */
858 if (!NT_SUCCESS(Status))
859 {
861 return Status;
862 }
863
864 /* Set up the session working set */
866 if (!NT_SUCCESS(Status))
867 {
868 /* Fail */
869 //MiDereferenceSession();
870 ASSERT(FALSE);
872 return Status;
873 }
874
875 /* All done */
877
878 /* Set and assert the flags, and return */
882 return Status;
883}
ULONG SessionId
Definition: dllmain.c:28
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define PSF_PROCESS_IN_SESSION_BIT
Definition: pstypes.h:289
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
PMM_SESSION_SPACE MmSessionSpace
Definition: session.c:21
NTSTATUS NTAPI MiSessionCreateInternal(OUT PULONG SessionId)
Definition: session.c:599
VOID NTAPI MiSessionLeader(IN PEPROCESS Process)
Definition: session.c:167
NTSTATUS NTAPI MiSessionInitializeWorkingSetList(VOID)
Definition: session.c:461
volatile LONG MiSessionLeaderExists
Definition: session.c:27
#define STATUS_ALREADY_COMMITTED
Definition: ntstatus.h:270
#define STATUS_INVALID_SYSTEM_SERVICE
Definition: ntstatus.h:265
#define PspSetProcessFlag(Process, Flag)
Definition: ps_x.h:33
union _MM_SESSION_SPACE::@1866 u
MM_SESSION_SPACE_FLAGS Flags
Definition: miarm.h:489
#define PsGetCurrentProcess
Definition: psfuncs.h:17

Referenced by SSI_DEF().

◆ MmSessionDelete()

NTSTATUS NTAPI MmSessionDelete ( IN ULONG  SessionId)

Definition at line 887 of file session.c.

888{
890
891 /* Process must be in a session */
892 if (!(Process->Flags & PSF_PROCESS_IN_SESSION_BIT))
893 {
894 DPRINT1("Not in a session!\n");
896 }
897
898 /* It must be the session leader */
899 if (!Process->Vm.Flags.SessionLeader)
900 {
901 DPRINT1("Not a session leader!\n");
903 }
904
905 /* Remove one reference count */
909
910 /* All done */
911 return STATUS_SUCCESS;
912}
VOID NTAPI MiDereferenceSession(VOID)
Definition: session.c:339
#define STATUS_UNABLE_TO_FREE_VM
Definition: ntstatus.h:263

Referenced by SSI_DEF().

◆ NtEnumerateSystemEnvironmentValuesEx()

NTSTATUS NTAPI NtEnumerateSystemEnvironmentValuesEx ( IN ULONG  InformationClass,
IN PVOID  Buffer,
IN ULONG  BufferLength 
)

Definition at line 557 of file sysinfo.c.

560{
563}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42

◆ NtGetCurrentProcessorNumber()

ULONG NTAPI NtGetCurrentProcessorNumber ( VOID  )

Definition at line 3061 of file sysinfo.c.

3062{
3063 /* Just use Ke */
3065}
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:341

Referenced by RtlGetCurrentProcessorNumber().

◆ NtQuerySystemEnvironmentValue()

NTSTATUS NTAPI NtQuerySystemEnvironmentValue ( IN PUNICODE_STRING  VariableName,
OUT PWSTR  ValueBuffer,
IN ULONG  ValueBufferLength,
IN OUT PULONG ReturnLength  OPTIONAL 
)

Definition at line 385 of file sysinfo.c.

389{
390 ANSI_STRING AName;
391 UNICODE_STRING WName;
393 PCH AnsiValueBuffer;
394 ANSI_STRING AValue;
395 UNICODE_STRING WValue;
398 PAGED_CODE();
399
400 /* Check if the call came from user mode */
403 {
405 {
406 /* Probe the input and output buffers */
407 ProbeForRead(VariableName, sizeof(UNICODE_STRING), sizeof(ULONG));
408 ProbeForWrite(ValueBuffer, ValueBufferLength, sizeof(WCHAR));
410 }
412 {
413 /* Return the exception code */
415 }
416 _SEH2_END;
417 }
418
419 /* According to NTInternals the SeSystemEnvironmentName privilege is required! */
421 {
422 DPRINT1("NtQuerySystemEnvironmentValue: Caller requires the SeSystemEnvironmentPrivilege privilege!\n");
424 }
425
426 /* Copy the name to kernel space if necessary */
427 Status = ProbeAndCaptureUnicodeString(&WName, PreviousMode, VariableName);
428 if (!NT_SUCCESS(Status)) return Status;
429
430 /* Convert the name to ANSI and release the captured UNICODE string */
431 Status = RtlUnicodeStringToAnsiString(&AName, &WName, TRUE);
433 if (!NT_SUCCESS(Status)) return Status;
434
435 /* Allocate a buffer for the ANSI environment variable */
436 AnsiValueBuffer = ExAllocatePoolWithTag(NonPagedPool, MAX_ENVVAL_SIZE, 'rvnE');
437 if (AnsiValueBuffer == NULL)
438 {
439 RtlFreeAnsiString(&AName);
441 }
442
443 /* Get the environment variable and free the ANSI name */
446 AnsiValueBuffer);
447 RtlFreeAnsiString(&AName);
448
449 /* Check if we had success */
450 if (Result == ESUCCESS)
451 {
452 /* Copy the result back to the caller. */
454 {
455 /* Initialize ANSI string from the result */
456 RtlInitAnsiString(&AValue, AnsiValueBuffer);
457
458 /* Initialize a UNICODE string from the callers buffer */
459 RtlInitEmptyUnicodeString(&WValue, ValueBuffer, (USHORT)ValueBufferLength);
460
461 /* Convert the result to UNICODE */
462 Status = RtlAnsiStringToUnicodeString(&WValue, &AValue, FALSE);
463
464 if (ReturnLength != NULL)
465 *ReturnLength = WValue.Length;
466 }
468 {
470 }
471 _SEH2_END;
472 }
473 else
474 {
476 }
477
478 /* Free the allocated ANSI value buffer */
479 ExFreePoolWithTag(AnsiValueBuffer, 'rvnE');
480
481 return Status;
482}
#define PAGED_CODE()
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
_In_ PVOID _In_ ULONG _Out_ PVOID _In_ ULONG _Inout_ PULONG _In_ KPROCESSOR_MODE PreviousMode
#define ExGetPreviousMode
Definition: ex.h:143
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:349
#define KernelMode
Definition: asm.h:38
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
CHAR * PCH
Definition: ntbasedef.h:399
#define MAX_ENVVAL_SIZE
Definition: sysinfo.c:20
const LUID SeSystemEnvironmentPrivilege
Definition: priv.c:41
BOOLEAN NTAPI SeSinglePrivilegeCheck(_In_ LUID PrivilegeValue, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a single privilege is present in the context of the calling thread.
Definition: priv.c:744
ARC_STATUS NTAPI HalGetEnvironmentVariable(IN PCH Name, IN USHORT ValueLength, IN PCH Value)
Definition: rtc.c:70
@ ESUCCESS
Definition: arc.h:32
ULONG ARC_STATUS
Definition: arc.h:4
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
Definition: probe.h:142
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
Definition: probe.h:239
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Test_API().

◆ NtQuerySystemEnvironmentValueEx()

NTSTATUS NTAPI NtQuerySystemEnvironmentValueEx ( _In_ PUNICODE_STRING  VariableName,
_In_ LPGUID  VendorGuid,
_Out_opt_ PVOID  Value,
_Inout_ PULONG  ReturnLength,
_Out_opt_ PULONG  Attributes 
)

Definition at line 567 of file sysinfo.c.

573{
576}

Referenced by _Success_().

◆ NtQuerySystemInformation()

__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation ( _In_ SYSTEM_INFORMATION_CLASS  SystemInformationClass,
_Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID  SystemInformation,
_In_ ULONG  SystemInformationLength,
_Out_opt_ PULONG  ReturnLength 
)

Definition at line 2937 of file sysinfo.c.

2942{
2944 ULONG CapturedResultLength = 0;
2947
2948 PAGED_CODE();
2949
2951
2952 _SEH2_TRY
2953 {
2954#if (NTDDI_VERSION >= NTDDI_VISTA)
2955 /*
2956 * Check whether the request is valid.
2957 */
2958 if (SystemInformationClass < MIN_SYSTEM_INFO_CLASS ||
2959 SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
2960 {
2962 }
2963#endif
2964
2965 if (PreviousMode != KernelMode)
2966 {
2967 /* SystemKernelDebuggerInformation needs only BOOLEAN alignment */
2968 if (SystemInformationClass == SystemKernelDebuggerInformation)
2970
2971 ProbeForWrite(SystemInformation, SystemInformationLength, Alignment);
2972 if (ReturnLength != NULL)
2974 }
2975
2976 if (ReturnLength)
2977 *ReturnLength = 0;
2978
2979#if (NTDDI_VERSION < NTDDI_VISTA)
2980 /*
2981 * Check whether the request is valid.
2982 */
2983 if (SystemInformationClass < MIN_SYSTEM_INFO_CLASS ||
2984 SystemInformationClass >= MAX_SYSTEM_INFO_CLASS)
2985 {
2987 }
2988#endif
2989
2990 if (CallQS[SystemInformationClass].Query != NULL)
2991 {
2992 /* Hand the request to a subhandler */
2993 Status = CallQS[SystemInformationClass].Query(SystemInformation,
2994 SystemInformationLength,
2995 &CapturedResultLength);
2996
2997 /* Save the result length to the caller */
2998 if (ReturnLength)
2999 *ReturnLength = CapturedResultLength;
3000 }
3001 }
3003 {
3005 }
3006 _SEH2_END;
3007
3008 return Status;
3009}
unsigned char BOOLEAN
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
@ SystemKernelDebuggerInformation
Definition: ntddk_ex.h:46
#define TYPE_ALIGNMENT(t)
Definition: ntbasedef.h:117
#define MAX_SYSTEM_INFO_CLASS
Definition: sysinfo.c:2929
#define MIN_SYSTEM_INFO_CLASS
Definition: sysinfo.c:2928
static QSSI_CALLS CallQS[]
Definition: sysinfo.c:2846
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240
NTSTATUS(* Query)(PVOID, ULONG, PULONG)
Definition: sysinfo.c:2830

◆ NtSetSystemEnvironmentValue()

NTSTATUS NTAPI NtSetSystemEnvironmentValue ( IN PUNICODE_STRING  VariableName,
IN PUNICODE_STRING  Value 
)

Definition at line 487 of file sysinfo.c.

489{
490 UNICODE_STRING CapturedName, CapturedValue;
491 ANSI_STRING AName, AValue;
494
495 PAGED_CODE();
496
498
499 /*
500 * Copy the strings to kernel space if necessary
501 */
502 Status = ProbeAndCaptureUnicodeString(&CapturedName,
504 VariableName);
505 if (NT_SUCCESS(Status))
506 {
507 Status = ProbeAndCaptureUnicodeString(&CapturedValue,
509 Value);
510 if (NT_SUCCESS(Status))
511 {
512 /*
513 * according to ntinternals the SeSystemEnvironmentName privilege is required!
514 */
517 {
518 /*
519 * convert the strings to ANSI
520 */
522 &CapturedName,
523 TRUE);
524 if (NT_SUCCESS(Status))
525 {
527 &CapturedValue,
528 TRUE);
529 if (NT_SUCCESS(Status))
530 {
532 AValue.Buffer);
533
535 }
536 }
537 }
538 else
539 {
540 DPRINT1("NtSetSystemEnvironmentValue: Caller requires the SeSystemEnvironmentPrivilege privilege!\n");
542 }
543
544 ReleaseCapturedUnicodeString(&CapturedValue,
546 }
547
548 ReleaseCapturedUnicodeString(&CapturedName,
550 }
551
552 return Status;
553}
ARC_STATUS NTAPI HalSetEnvironmentVariable(IN PCH Name, IN PCH Value)
Definition: rtc.c:57
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

◆ NtSetSystemEnvironmentValueEx()

NTSTATUS NTAPI NtSetSystemEnvironmentValueEx ( _In_ PUNICODE_STRING  VariableName,
_In_ LPGUID  VendorGuid,
_In_reads_bytes_opt_(ValueLength) PVOID  Value,
_In_ ULONG  ValueLength,
_In_ ULONG  Attributes 
)

Definition at line 580 of file sysinfo.c.

586{
589}

Referenced by SetFirmwareEnvironmentVariableExW().

◆ NtSetSystemInformation()

__kernel_entry NTSTATUS NTAPI NtSetSystemInformation ( _In_ SYSTEM_INFORMATION_CLASS  SystemInformationClass,
_In_reads_bytes_(SystemInformationLength) PVOID  SystemInformation,
_In_ ULONG  SystemInformationLength 
)

Definition at line 3014 of file sysinfo.c.

3018{
3021
3022 PAGED_CODE();
3023
3025
3026 _SEH2_TRY
3027 {
3028 /*
3029 * If called from user mode, check possible unsafe arguments.
3030 */
3031 if (PreviousMode != KernelMode)
3032 {
3033 ProbeForRead(SystemInformation, SystemInformationLength, sizeof(ULONG));
3034 }
3035
3036 /*
3037 * Check whether the request is valid.
3038 */
3039 if ((SystemInformationClass >= MIN_SYSTEM_INFO_CLASS) &&
3040 (SystemInformationClass < MAX_SYSTEM_INFO_CLASS))
3041 {
3042 if (CallQS[SystemInformationClass].Set != NULL)
3043 {
3044 /* Hand the request to a subhandler */
3045 Status = CallQS[SystemInformationClass].Set(SystemInformation,
3046 SystemInformationLength);
3047 }
3048 }
3049 }
3051 {
3053 }
3054 _SEH2_END;
3055
3056 return Status;
3057}
static BOOL Set
Definition: pageheap.c:10
NTSTATUS(* Set)(PVOID, ULONG)
Definition: sysinfo.c:2831

◆ QSI_DEF() [1/55]

QSI_DEF ( SystemBasicInformation  )

Definition at line 617 of file sysinfo.c.

618{
621
622 *ReqSize = sizeof(SYSTEM_BASIC_INFORMATION);
623
624 /* Check user buffer's size */
625 if (Size != sizeof(SYSTEM_BASIC_INFORMATION))
626 {
628 }
629
630 RtlZeroMemory(Sbi, Size);
631 Sbi->Reserved = 0;
633 Sbi->PageSize = PAGE_SIZE;
637 Sbi->AllocationGranularity = MM_VIRTMEM_GRANULARITY; /* hard coded on Intel? */
638 Sbi->MinimumUserModeAddress = 0x10000; /* Top of 64k */
642
643 return STATUS_SUCCESS;
644}
#define ULONG_PTR
Definition: config.h:101
#define PAGE_SIZE
Definition: env_spec_w32.h:49
PFN_NUMBER MmLowestPhysicalPage
Definition: meminit.c:30
PFN_NUMBER MmHighestPhysicalPage
Definition: meminit.c:31
KAFFINITY KeActiveProcessors
Definition: processor.c:17
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
#define MM_VIRTMEM_GRANULARITY
Definition: mm.h:102
ULONG KeMaximumIncrement
Definition: clock.c:20
CCHAR KeNumberProcessors
Definition: processor.c:16
PVOID MmHighestUserAddress
Definition: rtlcompat.c:29
struct _SYSTEM_BASIC_INFORMATION * PSYSTEM_BASIC_INFORMATION
struct _SYSTEM_BASIC_INFORMATION SYSTEM_BASIC_INFORMATION
KAFFINITY ActiveProcessorsAffinityMask
Definition: ntddk_ex.h:167
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

◆ QSI_DEF() [2/55]

Definition at line 1136 of file sysinfo.c.

1137{
1138 /* FIXME */
1139 DPRINT1("NtQuerySystemInformation - SystemCallCountInformation not implemented\n");
1141}

◆ QSI_DEF() [3/55]

Definition at line 1248 of file sysinfo.c.

1249{
1250 /* FIXME */
1251 DPRINT1("NtQuerySystemInformation - SystemCallTimeInformation not implemented\n");
1253}

◆ QSI_DEF() [4/55]

Definition at line 1852 of file sysinfo.c.

1853{
1854 PSYSTEM_CONTEXT_SWITCH_INFORMATION ContextSwitchInformation =
1856 ULONG ContextSwitches;
1857 PKPRCB Prcb;
1858 CHAR i;
1859
1860 /* Check size of a buffer, it must match our expectations */
1863
1864 /* Calculate total value of context switches across all processors */
1865 ContextSwitches = 0;
1866 for (i = 0; i < KeNumberProcessors; i ++)
1867 {
1868 Prcb = KiProcessorBlock[i];
1869 if (Prcb)
1870 {
1871 ContextSwitches += KeGetContextSwitches(Prcb);
1872 }
1873 }
1874
1875 ContextSwitchInformation->ContextSwitches = ContextSwitches;
1876
1877 /* FIXME */
1878 ContextSwitchInformation->FindAny = 0;
1879 ContextSwitchInformation->FindLast = 0;
1880 ContextSwitchInformation->FindIdeal = 0;
1881 ContextSwitchInformation->IdleAny = 0;
1882 ContextSwitchInformation->IdleCurrent = 0;
1883 ContextSwitchInformation->IdleLast = 0;
1884 ContextSwitchInformation->IdleIdeal = 0;
1885 ContextSwitchInformation->PreemptAny = 0;
1886 ContextSwitchInformation->PreemptCurrent = 0;
1887 ContextSwitchInformation->PreemptLast = 0;
1888 ContextSwitchInformation->SwitchToIdle = 0;
1889
1890 return STATUS_SUCCESS;
1891}
struct _SYSTEM_CONTEXT_SWITCH_INFORMATION * PSYSTEM_CONTEXT_SWITCH_INFORMATION
#define KeGetContextSwitches(Prcb)
Definition: ke.h:216
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:31
char CHAR
Definition: xmlstorage.h:175

◆ QSI_DEF() [5/55]

Definition at line 1775 of file sysinfo.c.

1776{
1777 /* FIXME */
1778 DPRINT1("NtQuerySystemInformation - SystemCrashDumpInformation not implemented\n");
1780}

◆ QSI_DEF() [6/55]

Definition at line 1820 of file sysinfo.c.

1821{
1822 /* FIXME */
1823 DPRINT1("NtQuerySystemInformation - SystemCrashDumpStateInformation not implemented\n");
1825}

◆ QSI_DEF() [7/55]

Definition at line 2074 of file sysinfo.c.

2075{
2076 *ReqSize = sizeof(RTL_TIME_ZONE_INFORMATION);
2077
2078 if (sizeof(RTL_TIME_ZONE_INFORMATION) != Size)
2079 {
2081 }
2082
2083 /* Copy the time zone information struct */
2084 memcpy(Buffer,
2087
2088 return STATUS_SUCCESS;
2089}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct _RTL_TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION
RTL_TIME_ZONE_INFORMATION ExpTimeZoneInfo
Definition: time.c:21

◆ QSI_DEF() [8/55]

QSI_DEF ( SystemDeviceInformation  )

Definition at line 1144 of file sysinfo.c.

1145{
1148 PCONFIGURATION_INFORMATION ConfigInfo;
1149
1150 *ReqSize = sizeof(SYSTEM_DEVICE_INFORMATION);
1151
1152 /* Check user buffer's size */
1153 if (Size < sizeof(SYSTEM_DEVICE_INFORMATION))
1154 {
1156 }
1157
1158 ConfigInfo = IoGetConfigurationInformation();
1159
1160 Sdi->NumberOfDisks = ConfigInfo->DiskCount;
1161 Sdi->NumberOfFloppies = ConfigInfo->FloppyCount;
1162 Sdi->NumberOfCdRoms = ConfigInfo->CdRomCount;
1163 Sdi->NumberOfTapes = ConfigInfo->TapeCount;
1164 Sdi->NumberOfSerialPorts = ConfigInfo->SerialCount;
1165 Sdi->NumberOfParallelPorts = ConfigInfo->ParallelCount;
1166
1167 return STATUS_SUCCESS;
1168}
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
Returns a pointer to the I/O manager's global configuration information structure.
Definition: iorsrce.c:998
struct _SYSTEM_DEVICE_INFORMATION * PSYSTEM_DEVICE_INFORMATION
struct _SYSTEM_DEVICE_INFORMATION SYSTEM_DEVICE_INFORMATION

◆ QSI_DEF() [9/55]

Definition at line 1562 of file sysinfo.c.

1563{
1565
1567 {
1569 }
1570
1575
1576 return STATUS_SUCCESS;
1577}
struct _SYSTEM_DPC_BEHAVIOR_INFORMATION * PSYSTEM_DPC_BEHAVIOR_INFORMATION
ULONG KiAdjustDpcThreshold
Definition: dpc.c:21
ULONG KiMaximumDpcQueueDepth
Definition: dpc.c:19
ULONG KiMinimumDpcRate
Definition: dpc.c:20
ULONG KiIdealDpcRate
Definition: dpc.c:22

◆ QSI_DEF() [10/55]

Definition at line 1783 of file sysinfo.c.

1784{
1785 PSYSTEM_EXCEPTION_INFORMATION ExceptionInformation =
1787 PKPRCB Prcb;
1788 ULONG AlignmentFixupCount = 0, ExceptionDispatchCount = 0;
1789 ULONG FloatingEmulationCount = 0, ByteWordEmulationCount = 0;
1790 CHAR i;
1791
1792 /* Check size of a buffer, it must match our expectations */
1793 if (sizeof(SYSTEM_EXCEPTION_INFORMATION) != Size)
1795
1796 /* Sum up exception count information from all processors */
1797 for (i = 0; i < KeNumberProcessors; i++)
1798 {
1799 Prcb = KiProcessorBlock[i];
1800 if (Prcb)
1801 {
1802 AlignmentFixupCount += Prcb->KeAlignmentFixupCount;
1803 ExceptionDispatchCount += Prcb->KeExceptionDispatchCount;
1804#ifndef _M_ARM
1805 FloatingEmulationCount += Prcb->KeFloatingEmulationCount;
1806#endif // _M_ARM
1807 }
1808 }
1809
1810 /* Save information in user's buffer */
1811 ExceptionInformation->AlignmentFixupCount = AlignmentFixupCount;
1812 ExceptionInformation->ExceptionDispatchCount = ExceptionDispatchCount;
1813 ExceptionInformation->FloatingEmulationCount = FloatingEmulationCount;
1814 ExceptionInformation->ByteWordEmulationCount = ByteWordEmulationCount;
1815
1816 return STATUS_SUCCESS;
1817}
struct _SYSTEM_EXCEPTION_INFORMATION * PSYSTEM_EXCEPTION_INFORMATION
ULONG KeExceptionDispatchCount
Definition: ketypes.h:794
ULONG KeAlignmentFixupCount
Definition: ketypes.h:889

◆ QSI_DEF() [11/55]

Definition at line 2496 of file sysinfo.c.

2497{
2499 PLIST_ENTRY NextTableEntry;
2501 PHANDLE_TABLE_ENTRY HandleTableEntry;
2503 ULONG Index = 0;
2505 PMDL Mdl;
2506 PAGED_CODE();
2507
2508 DPRINT("NtQuerySystemInformation - SystemExtendedHandleInformation\n");
2509
2510 /* Set initial required buffer size */
2512
2513 /* Check user's buffer size */
2514 if (Size < *ReqSize)
2515 {
2517 }
2518
2519 /* We need to lock down the memory */
2521 Size,
2525 &Mdl);
2526 if (!NT_SUCCESS(Status))
2527 {
2528 DPRINT1("Failed to lock the user buffer: 0x%lx\n", Status);
2529 return Status;
2530 }
2531
2532 /* Reset of count of handles */
2533 HandleInformation->Count = 0;
2534
2535 /* Enter a critical region */
2537
2538 /* Acquire the handle table lock */
2540
2541 /* Enumerate all system handles */
2542 for (NextTableEntry = HandleTableListHead.Flink;
2543 NextTableEntry != &HandleTableListHead;
2544 NextTableEntry = NextTableEntry->Flink)
2545 {
2546 /* Get current handle table */
2547 HandleTable = CONTAINING_RECORD(NextTableEntry, HANDLE_TABLE, HandleTableList);
2548
2549 /* Set the initial value and loop the entries */
2550 Handle.Value = 0;
2551 while ((HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, Handle)))
2552 {
2553 /* Validate the entry */
2554 if ((HandleTableEntry->Object) &&
2555 (HandleTableEntry->NextFreeTableEntry != -2))
2556 {
2557 /* Increase of count of handles */
2558 ++HandleInformation->Count;
2559
2560 /* Lock the entry */
2561 if (ExpLockHandleTableEntry(HandleTable, HandleTableEntry))
2562 {
2563 /* Increase required buffer size */
2564 *ReqSize += sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX);
2565
2566 /* Check user's buffer size */
2567 if (*ReqSize > Size)
2568 {
2570 }
2571 else
2572 {
2573 POBJECT_HEADER ObjectHeader = ObpGetHandleObject(HandleTableEntry);
2574
2575 /* Filling handle information */
2576 HandleInformation->Handle[Index].UniqueProcessId =
2577 (USHORT)(ULONG_PTR) HandleTable->UniqueProcessId;
2578
2579 HandleInformation->Handle[Index].CreatorBackTraceIndex = 0;
2580
2581#if 0 /* FIXME!!! Type field corrupted */
2582 HandleInformation->Handles[Index].ObjectTypeIndex =
2583 (UCHAR) ObjectHeader->Type->Index;
2584#else
2585 HandleInformation->Handle[Index].ObjectTypeIndex = 0;
2586#endif
2587
2588 HandleInformation->Handle[Index].HandleAttributes =
2589 HandleTableEntry->ObAttributes & OBJ_HANDLE_ATTRIBUTES;
2590
2591 HandleInformation->Handle[Index].HandleValue =
2592 (USHORT)(ULONG_PTR) Handle.GenericHandleOverlay;
2593
2594 HandleInformation->Handle[Index].Object = &ObjectHeader->Body;
2595
2596 HandleInformation->Handle[Index].GrantedAccess =
2597 HandleTableEntry->GrantedAccess;
2598
2599 HandleInformation->Handle[Index].Reserved = 0;
2600
2601 ++Index;
2602 }
2603
2604 /* Unlock it */
2605 ExUnlockHandleTableEntry(HandleTable, HandleTableEntry);
2606 }
2607 }
2608
2609 /* Go to the next entry */
2610 Handle.Value += sizeof(HANDLE);
2611 }
2612 }
2613
2614 /* Release the lock */
2616
2617 /* Leave the critical region */
2619
2620 /* Release the locked user buffer */
2622
2623 return Status;
2624}
FORCEINLINE VOID ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1108
FORCEINLINE VOID ExReleasePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1216
ULONG Handle
Definition: gdb_input.c:15
static XMS_HANDLE HandleTable[XMS_MAX_HANDLES]
Definition: himem.c:83
struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
PHANDLE_TABLE_ENTRY NTAPI ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN EXHANDLE Handle)
Definition: handle.c:43
BOOLEAN NTAPI ExpLockHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry)
Definition: handle.c:884
VOID NTAPI ExUnlockHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry)
Definition: handle.c:923
EX_PUSH_LOCK HandleTableListLock
Definition: handle.c:19
LIST_ENTRY HandleTableListHead
Definition: handle.c:18
NTSTATUS NTAPI ExLockUserBuffer(PVOID BaseAddress, ULONG Length, KPROCESSOR_MODE AccessMode, LOCK_OPERATION Operation, PVOID *MappedSystemVa, PMDL *OutMdl)
Definition: sysinfo.c:202
#define OBJ_HANDLE_ATTRIBUTES
Definition: ob.h:52
#define ObpGetHandleObject(x)
Definition: ob.h:91
#define DPRINT
Definition: sndvol32.h:73
Definition: extypes.h:596
PVOID Object
Definition: extypes.h:599
ULONG GrantedAccess
Definition: extypes.h:606
ULONG_PTR ObAttributes
Definition: extypes.h:600
LONG NextFreeTableEntry
Definition: extypes.h:612
POBJECT_TYPE Type
Definition: obtypes.h:493
ULONG Index
Definition: obtypes.h:385
PVOID HANDLE
Definition: typedefs.h:73
uint32_t ULONG_PTR
Definition: typedefs.h:65
Definition: ex.h:90
_In_ WDFCOLLECTION _In_ ULONG Index
@ IoWriteAccess
Definition: ketypes.h:864
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:44
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ QSI_DEF() [12/55]

Definition at line 2426 of file sysinfo.c.

2427{
2428 /* FIXME */
2429 DPRINT1("NtQuerySystemInformation - SystemExtendedProcessInformation not implemented\n");
2431}

◆ QSI_DEF() [13/55]

Definition at line 1487 of file sysinfo.c.

1488{
1490
1491 *ReqSize = sizeof(SYSTEM_FILECACHE_INFORMATION);
1492
1493 if (Size < *ReqSize)
1494 {
1496 }
1497
1499
1500 /* Return the Byte size not the page size. */
1501 Sci->CurrentSize = MiMemoryConsumers[MC_USER].PagesUsed; /* FIXME */
1502 Sci->PeakSize = MiMemoryConsumers[MC_USER].PagesUsed; /* FIXME */
1503 /* Taskmgr multiplies this one by page size right away */
1505 /* system working set and standby pages. */
1506 Sci->PageFaultCount = 0; /* FIXME */
1507 Sci->MinimumWorkingSet = 0; /* FIXME */
1508 Sci->MaximumWorkingSet = 0; /* FIXME */
1509
1510 return STATUS_SUCCESS;
1511}
struct _SYSTEM_FILECACHE_INFORMATION SYSTEM_FILECACHE_INFORMATION
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]
Definition: balance.c:28
#define MC_USER
Definition: mm.h:114
ULONG PagesUsed
Definition: mm.h:464
SIZE_T CurrentSizeIncludingTransitionInPages
Definition: extypes.h:1131

◆ QSI_DEF() [14/55]

Definition at line 2727 of file sysinfo.c.

2728{
2731 ULONG InputBufSize;
2732 ULONG DataSize = 0;
2733 ULONG TableCount = 0;
2734
2735 DPRINT("NtQuerySystemInformation - SystemFirmwareTableInformation\n");
2736
2737 /* Set initial required buffer size */
2738 *ReqSize = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
2739
2740 /* Check user's buffer size */
2741 if (Size < *ReqSize)
2742 {
2744 }
2745
2746 InputBufSize = SysFirmwareInfo->TableBufferLength;
2747 switch (SysFirmwareInfo->ProviderSignature)
2748 {
2749 /*
2750 * ExpFirmwareTableResource and ExpFirmwareTableProviderListHead
2751 * variables should be used there somehow...
2752 */
2753 case SIG_ACPI:
2754 {
2755 /* FIXME: Not implemented yet */
2756 DPRINT1("ACPI provider not implemented\n");
2758 break;
2759 }
2760 case SIG_FIRM:
2761 {
2762 /* FIXME: Not implemented yet */
2763 DPRINT1("FIRM provider not implemented\n");
2765 break;
2766 }
2767 case SIG_RSMB:
2768 {
2770 if (DataSize > 0)
2771 {
2772 TableCount = 1;
2773 if (SysFirmwareInfo->Action == SystemFirmwareTable_Enumerate)
2774 {
2775 DataSize = TableCount * sizeof(ULONG);
2776 if (DataSize <= InputBufSize)
2777 {
2778 *(ULONG *)SysFirmwareInfo->TableBuffer = 0;
2779 }
2780 }
2781 else if (SysFirmwareInfo->Action == SystemFirmwareTable_Get
2782 && DataSize <= InputBufSize)
2783 {
2784 Status = ExpGetRawSMBiosTable(SysFirmwareInfo->TableBuffer, &DataSize, InputBufSize);
2785 }
2786 SysFirmwareInfo->TableBufferLength = DataSize;
2787 }
2788 break;
2789 }
2790 default:
2791 {
2792 DPRINT1("SystemFirmwareTableInformation: Unsupported provider (0x%x)\n",
2793 SysFirmwareInfo->ProviderSignature);
2795 }
2796 }
2797
2798 if (NT_SUCCESS(Status))
2799 {
2800 switch (SysFirmwareInfo->Action)
2801 {
2804 {
2805 if (SysFirmwareInfo->TableBufferLength > InputBufSize)
2806 {
2808 }
2809 break;
2810 }
2811 default:
2812 {
2813 DPRINT1("SystemFirmwareTableInformation: Unsupported action (0x%x)\n",
2814 SysFirmwareInfo->Action);
2816 }
2817 }
2818 }
2819 else
2820 {
2821 SysFirmwareInfo->TableBufferLength = 0;
2822 }
2823 return Status;
2824}
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION * PSYSTEM_FIRMWARE_TABLE_INFORMATION
@ SystemFirmwareTable_Enumerate
@ SystemFirmwareTable_Get
#define SIG_RSMB
Definition: sysinfo.c:24
#define SIG_FIRM
Definition: sysinfo.c:23
#define SIG_ACPI
Definition: sysinfo.c:22
NTSTATUS NTAPI ExpGetRawSMBiosTable(_Out_opt_ PVOID Buffer, _Out_ ULONG *OutSize, _In_ ULONG BufferSize)
Definition: sysinfo.c:250
#define STATUS_ILLEGAL_FUNCTION
Definition: ntstatus.h:411
SYSTEM_FIRMWARE_TABLE_ACTION Action

◆ QSI_DEF() [15/55]

QSI_DEF ( SystemFlagsInformation  )

Definition at line 1208 of file sysinfo.c.

1209{
1210#if (NTDDI_VERSION >= NTDDI_VISTA)
1211 *ReqSize = sizeof(SYSTEM_FLAGS_INFORMATION);
1212#endif
1213
1214 if (sizeof(SYSTEM_FLAGS_INFORMATION) != Size)
1215 {
1217 }
1218
1220#if (NTDDI_VERSION < NTDDI_VISTA)
1221 *ReqSize = sizeof(SYSTEM_FLAGS_INFORMATION);
1222#endif
1223
1224 return STATUS_SUCCESS;
1225}
struct _SYSTEM_FLAGS_INFORMATION SYSTEM_FLAGS_INFORMATION
struct _SYSTEM_FLAGS_INFORMATION * PSYSTEM_FLAGS_INFORMATION
ULONG NtGlobalFlag
Definition: init.c:54

◆ QSI_DEF() [16/55]

Definition at line 1587 of file sysinfo.c.

1588{
1589 PULONG Spi = (PULONG) Buffer;
1590
1592
1593 *ReqSize = sizeof(ULONG);
1594
1595 if (sizeof(ULONG) != Size)
1596 {
1598 }
1599
1600 DPRINT("SystemFullMemoryInformation\n");
1601
1603
1604 DPRINT("PID: %p, KernelTime: %u PFFree: %lu PFUsed: %lu\n",
1609
1611
1612 return STATUS_SUCCESS;
1613}
PEPROCESS TheIdleProcess
Definition: kdpacket.c:30
PFN_COUNT MiFreeSwapPages
Definition: pagefile.c:66
PFN_COUNT MiUsedSwapPages
Definition: pagefile.c:69
PEPROCESS PsIdleProcess
Definition: psmgr.c:51
KPROCESS Pcb
Definition: pstypes.h:1263
HANDLE UniqueProcessId
Definition: pstypes.h:1268
ULONG KernelTime
Definition: ketypes.h:2102
uint32_t * PULONG
Definition: typedefs.h:59

◆ QSI_DEF() [17/55]

QSI_DEF ( SystemHandleInformation  )

Definition at line 1310 of file sysinfo.c.

1311{
1313 PLIST_ENTRY NextTableEntry;
1315 PHANDLE_TABLE_ENTRY HandleTableEntry;
1317 ULONG Index = 0;
1319 PMDL Mdl;
1320 PAGED_CODE();
1321
1322 DPRINT("NtQuerySystemInformation - SystemHandleInformation\n");
1323
1324 /* Set initial required buffer size */
1325 *ReqSize = FIELD_OFFSET(SYSTEM_HANDLE_INFORMATION, Handles);
1326
1327 /* Check user's buffer size */
1328 if (Size < *ReqSize)
1329 {
1331 }
1332
1333 /* We need to lock down the memory */
1335 Size,
1339 &Mdl);
1340 if (!NT_SUCCESS(Status))
1341 {
1342 DPRINT1("Failed to lock the user buffer: 0x%lx\n", Status);
1343 return Status;
1344 }
1345
1346 /* Reset of count of handles */
1347 HandleInformation->NumberOfHandles = 0;
1348
1349 /* Enter a critical region */
1351
1352 /* Acquire the handle table lock */
1354
1355 /* Enumerate all system handles */
1356 for (NextTableEntry = HandleTableListHead.Flink;
1357 NextTableEntry != &HandleTableListHead;
1358 NextTableEntry = NextTableEntry->Flink)
1359 {
1360 /* Get current handle table */
1361 HandleTable = CONTAINING_RECORD(NextTableEntry, HANDLE_TABLE, HandleTableList);
1362
1363 /* Set the initial value and loop the entries */
1364 Handle.Value = 0;
1365 while ((HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, Handle)))
1366 {
1367 /* Validate the entry */
1368 if ((HandleTableEntry->Object) &&
1369 (HandleTableEntry->NextFreeTableEntry != -2))
1370 {
1371 /* Increase of count of handles */
1372 ++HandleInformation->NumberOfHandles;
1373
1374 /* Lock the entry */
1375 if (ExpLockHandleTableEntry(HandleTable, HandleTableEntry))
1376 {
1377 /* Increase required buffer size */
1378 *ReqSize += sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO);
1379
1380 /* Check user's buffer size */
1381 if (*ReqSize > Size)
1382 {
1384 }
1385 else
1386 {
1387 POBJECT_HEADER ObjectHeader = ObpGetHandleObject(HandleTableEntry);
1388
1389 /* Filling handle information */
1390 HandleInformation->Handles[Index].UniqueProcessId =
1391 (USHORT)(ULONG_PTR) HandleTable->UniqueProcessId;
1392
1393 HandleInformation->Handles[Index].CreatorBackTraceIndex = 0;
1394
1395#if 0 /* FIXME!!! Type field corrupted */
1396 HandleInformation->Handles[Index].ObjectTypeIndex =
1397 (UCHAR) ObjectHeader->Type->Index;
1398#else
1399 HandleInformation->Handles[Index].ObjectTypeIndex = 0;
1400#endif
1401
1402 HandleInformation->Handles[Index].HandleAttributes =
1403 HandleTableEntry->ObAttributes & OBJ_HANDLE_ATTRIBUTES;
1404
1405 HandleInformation->Handles[Index].HandleValue =
1406 (USHORT)(ULONG_PTR) Handle.GenericHandleOverlay;
1407
1408 HandleInformation->Handles[Index].Object = &ObjectHeader->Body;
1409
1410 HandleInformation->Handles[Index].GrantedAccess =
1411 HandleTableEntry->GrantedAccess;
1412
1413 ++Index;
1414 }
1415
1416 /* Unlock it */
1417 ExUnlockHandleTableEntry(HandleTable, HandleTableEntry);
1418 }
1419 }
1420
1421 /* Go to the next entry */
1422 Handle.Value += sizeof(HANDLE);
1423 }
1424 }
1425
1426 /* Release the lock */
1428
1429 /* Leave the critical region */
1431
1432 /* Release the locked user buffer */
1434
1435 return Status;
1436}
struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO SYSTEM_HANDLE_TABLE_ENTRY_INFO

◆ QSI_DEF() [18/55]

Definition at line 1532 of file sysinfo.c.

1533{
1534 PKPRCB Prcb;
1535 LONG i;
1536 ULONG ti;
1538
1540 {
1542 }
1543
1544 ti = KeQueryTimeIncrement();
1545
1546 for (i = 0; i < KeNumberProcessors; i++)
1547 {
1548 Prcb = KiProcessorBlock[i];
1550 sii->DpcCount = Prcb->DpcData[0].DpcCount;
1551 sii->DpcRate = Prcb->DpcRequestRate;
1552 sii->TimeIncrement = ti;
1553 sii->DpcBypassCount = 0;
1554 sii->ApcBypassCount = 0;
1555 sii++;
1556 }
1557
1558 return STATUS_SUCCESS;
1559}
struct _SYSTEM_INTERRUPT_INFORMATION * PSYSTEM_INTERRUPT_INFORMATION
ULONG NTAPI KeQueryTimeIncrement(VOID)
Definition: clock.c:153
long LONG
Definition: pedump.c:60
ULONG DpcCount
Definition: ketypes.h:860
KDPC_DATA DpcData[2]
Definition: ketypes.h:769
ULONG DpcRequestRate
Definition: ketypes.h:777

◆ QSI_DEF() [19/55]

Definition at line 1828 of file sysinfo.c.

1829{
1831
1832#if (NTDDI_VERSION >= NTDDI_VISTA)
1833 *ReqSize = sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION);
1834#endif
1835
1837 {
1839 }
1840
1843
1844#if (NTDDI_VERSION < NTDDI_VISTA)
1845 *ReqSize = sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION);
1846#endif
1847
1848 return STATUS_SUCCESS;
1849}
struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION SYSTEM_KERNEL_DEBUGGER_INFORMATION
struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION * PSYSTEM_KERNEL_DEBUGGER_INFORMATION
#define KD_DEBUGGER_ENABLED
Definition: kdfuncs.h:130
#define KD_DEBUGGER_NOT_PRESENT
Definition: kdfuncs.h:133

◆ QSI_DEF() [20/55]

QSI_DEF ( SystemLegacyDriverInformation  )

Definition at line 2066 of file sysinfo.c.

2067{
2068 /* FIXME */
2069 DPRINT1("NtQuerySystemInformation - SystemLegacyDriverInformation not implemented\n");
2071}

◆ QSI_DEF() [21/55]

QSI_DEF ( SystemLocksInformation  )

Definition at line 1278 of file sysinfo.c.

1279{
1280 /* FIXME */
1281 DPRINT1("NtQuerySystemInformation - SystemLocksInformation not implemented\n");
1283}

◆ QSI_DEF() [22/55]

Definition at line 2643 of file sysinfo.c.

2644{
2645 LONG i;
2646 PKPRCB Prcb;
2647 KAFFINITY CurrentProc;
2649 ULONG DataSize = 0, ProcessorFlags;
2651
2652 /* First, browse active processors, thanks to the map */
2653 i = 0;
2654 CurrentInfo = Buffer;
2655 CurrentProc = KeActiveProcessors;
2656 do
2657 {
2658 /* If current processor is active and is main in case of HT/MC, return it */
2659 Prcb = KiProcessorBlock[i];
2660 if ((CurrentProc & 1) &&
2661 Prcb == Prcb->MultiThreadSetMaster)
2662 {
2663 /* Assume processor can do HT or multicore */
2664 ProcessorFlags = 1;
2665
2666 /* If set is the same for PRCB and multithread, then
2667 * actually, the processor is single core
2668 */
2669 if (Prcb->SetMember == Prcb->MultiThreadProcessorSet)
2670 {
2671 ProcessorFlags = 0;
2672 }
2673
2674 /* Check we have enough room to return */
2676 if (DataSize > Size)
2677 {
2679 }
2680 else
2681 {
2682 /* Zero output and return */
2684 CurrentInfo->ProcessorMask = Prcb->MultiThreadProcessorSet;
2685
2686 /* Processor core needs 1 if HT/MC is supported */
2687 CurrentInfo->Relationship = RelationProcessorCore;
2688 CurrentInfo->ProcessorCore.Flags = ProcessorFlags;
2689 ++CurrentInfo;
2690 }
2691 }
2692
2693 /* Move to the next proc */
2694 CurrentProc >>= 1;
2695 ++i;
2696 /* Loop while there's someone in the bitmask */
2697 } while (CurrentProc != 0);
2698
2699 /* Now, return the NUMA nodes */
2700 for (i = 0; i < KeNumberNodes; ++i)
2701 {
2702 /* Check we have enough room to return */
2704 if (DataSize > Size)
2705 {
2707 }
2708 else
2709 {
2710 /* Zero output and return */
2712 CurrentInfo->ProcessorMask = KeActiveProcessors;
2713
2714 /* NUMA node needs its ID */
2715 CurrentInfo->Relationship = RelationNumaNode;
2716 CurrentInfo->NumaNode.NodeNumber = i;
2717 ++CurrentInfo;
2718 }
2719 }
2720
2721 *ReqSize = DataSize;
2722
2723 return Status;
2724}
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR KeNumberNodes
Definition: krnlinit.c:36
struct _KPRCB * MultiThreadSetMaster
Definition: ketypes.h:846
UINT64 SetMember
Definition: ketypes.h:671
UINT64 MultiThreadProcessorSet
Definition: ketypes.h:845
struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION::@4189::@4191 NumaNode
LOGICAL_PROCESSOR_RELATIONSHIP Relationship
Definition: ketypes.h:99
struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION::@4189::@4190 ProcessorCore
@ RelationNumaNode
Definition: ketypes.h:83
@ RelationProcessorCore
Definition: ketypes.h:82
struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION SYSTEM_LOGICAL_PROCESSOR_INFORMATION

◆ QSI_DEF() [23/55]

Definition at line 2159 of file sysinfo.c.

2160{
2163 PMDL Mdl;
2164 ULONG MaxCount, Remaining;
2165 KIRQL OldIrql;
2167
2168 /* First we need to lock down the memory, since we are going to access it
2169 at high IRQL */
2172 Size,
2175 (PVOID*)&Info,
2176 &Mdl);
2177 if (!NT_SUCCESS(Status))
2178 {
2179 DPRINT1("Failed to lock the user buffer: 0x%lx\n", Status);
2180 return Status;
2181 }
2182
2183 /* Calculate how many items we can store */
2184 Remaining = MaxCount = Size / sizeof(SYSTEM_LOOKASIDE_INFORMATION);
2185 if (Remaining == 0)
2186 {
2187 goto Leave;
2188 }
2189
2190 /* Copy info from pool lookaside lists */
2192 &Remaining,
2194 FALSE);
2195 if (Remaining == 0)
2196 {
2197 goto Leave;
2198 }
2199
2200 /* Copy info from system lookaside lists */
2202 &Remaining,
2204 TRUE);
2205 if (Remaining == 0)
2206 {
2207 goto Leave;
2208 }
2209
2210 /* Acquire spinlock for ExpNonPagedLookasideListHead */
2212
2213 /* Copy info from non-paged lookaside lists */
2215 &Remaining,
2217 TRUE);
2218
2219 /* Release spinlock for ExpNonPagedLookasideListHead */
2221
2222 if (Remaining == 0)
2223 {
2224 goto Leave;
2225 }
2226
2227 /* Acquire spinlock for ExpPagedLookasideListHead */
2229
2230 /* Copy info from paged lookaside lists */
2232 &Remaining,
2234 TRUE);
2235
2236 /* Release spinlock for ExpPagedLookasideListHead */
2238
2239Leave:
2240
2241 /* Release the locked user buffer */
2243
2244 /* Return the size of the actually written data */
2245 *ReqSize = (MaxCount - Remaining) * sizeof(SYSTEM_LOOKASIDE_INFORMATION);
2246 return STATUS_SUCCESS;
2247}
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
KSPIN_LOCK ExpPagedLookasideListLock
Definition: lookas.c:20
KSPIN_LOCK ExpNonPagedLookasideListLock
Definition: lookas.c:18
LIST_ENTRY ExpPagedLookasideListHead
Definition: lookas.c:19
LIST_ENTRY ExSystemLookasideListHead
Definition: lookas.c:21
LIST_ENTRY ExpNonPagedLookasideListHead
Definition: lookas.c:17
struct _SYSTEM_LOOKASIDE_INFORMATION SYSTEM_LOOKASIDE_INFORMATION
static VOID ExpCopyLookasideInformation(PSYSTEM_LOOKASIDE_INFORMATION *InfoPointer, PULONG RemainingPointer, PLIST_ENTRY ListHead, BOOLEAN ListUsesMisses)
Definition: sysinfo.c:2104
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

◆ QSI_DEF() [24/55]

QSI_DEF ( SystemModuleInformation  )

Definition at line 1256 of file sysinfo.c.

1257{
1259
1260 /* Acquire system module list lock */
1263
1264 /* Call the generic handler with the system module list */
1268 Size,
1269 ReqSize);
1270
1271 /* Release list lock and return status */
1274 return Status;
1275}
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
NTSTATUS NTAPI ExpQueryModuleInformation(IN PLIST_ENTRY KernelModeList, IN PLIST_ENTRY UserModeList, OUT PRTL_PROCESS_MODULES Modules, IN ULONG Length, OUT PULONG ReturnLength)
Definition: sysinfo.c:91
LIST_ENTRY MmLoadedUserImageList
Definition: sysldr.c:22
LIST_ENTRY PsLoadedModuleList
Definition: sysldr.c:21
ERESOURCE PsLoadedModuleResource
Definition: sysldr.c:24

◆ QSI_DEF() [25/55]

Definition at line 1759 of file sysinfo.c.

1760{
1761 /* FIXME */
1762 DPRINT1("NtQuerySystemInformation - SystemNextEventIdInformation not implemented\n");
1764}

◆ QSI_DEF() [26/55]

Definition at line 1302 of file sysinfo.c.

1303{
1304 /* FIXME */
1305 DPRINT1("NtQuerySystemInformation - SystemNonPagedPoolInformation not implemented\n");
1307}

◆ QSI_DEF() [27/55]

Definition at line 2442 of file sysinfo.c.

2443{
2444 ULONG MaxEntries, Node;
2446
2447 /* Validate input size */
2448 if (Size < sizeof(ULONG))
2449 {
2451 }
2452
2453 /* Return highest node */
2454 NumaInformation->HighestNodeNumber = KeNumberNodes - 1;
2455
2456 /* Compute how much entries we will be able to put in output structure */
2457 MaxEntries = (Size - FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, AvailableMemory)) / sizeof(ULONGLONG);
2458 /* Make sure we don't overflow KeNodeBlock */
2459 if (MaxEntries > KeNumberNodes)
2460 {
2461 MaxEntries = KeNumberNodes;
2462 }
2463
2464 /* If we have entries to write, and room for it */
2465 if (Size >= FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, AvailableMemory) &&
2466 MaxEntries != 0)
2467 {
2468 /* Already set size we return */
2469 *ReqSize = FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, AvailableMemory) +
2470 MaxEntries * sizeof(ULONGLONG);
2471
2472 /* If we have a single entry (us), directly return MM information */
2473 if (MaxEntries == 1)
2474 {
2475 NumaInformation->AvailableMemory[0] = MmAvailablePages << PAGE_SHIFT;
2476 }
2477 else
2478 {
2479 /* Otherwise, for each node, return available bytes */
2480 for (Node = 0; Node < MaxEntries; ++Node)
2481 {
2482 NumaInformation->AvailableMemory[Node] = (KeNodeBlock[Node]->FreeCount[0] + KeNodeBlock[Node]->FreeCount[1]) << PAGE_SHIFT;
2483 }
2484 }
2485 }
2486 else
2487 {
2488 /* We only returned highest node number */
2489 *ReqSize = sizeof(ULONG);
2490 }
2491
2492 return STATUS_SUCCESS;
2493}
union node Node
Definition: types.h:1255
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
struct _SYSTEM_NUMA_INFORMATION * PSYSTEM_NUMA_INFORMATION
PKNODE KeNodeBlock[1]
Definition: krnlinit.c:35
PFN_NUMBER MmAvailablePages
Definition: freelist.c:26
ULONG_PTR FreeCount[2]
Definition: ketypes.h:896
ULONGLONG AvailableMemory[MAXIMUM_NUMA_NODES]
Definition: extypes.h:1413
Definition: dlist.c:348

◆ QSI_DEF() [28/55]

QSI_DEF ( SystemNumaProcessorMap  )

Definition at line 2372 of file sysinfo.c.

2373{
2374 ULONG MaxEntries, Node;
2376
2377 /* Validate input size */
2378 if (Size < sizeof(ULONG))
2379 {
2381 }
2382
2383 /* Return highest node */
2384 NumaInformation->HighestNodeNumber = KeNumberNodes - 1;
2385
2386 /* Compute how much entries we will be able to put in output structure */
2387 MaxEntries = (Size - FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask)) / sizeof(ULONGLONG);
2388 /* Make sure we don't overflow KeNodeBlock */
2389 if (MaxEntries > KeNumberNodes)
2390 {
2391 MaxEntries = KeNumberNodes;
2392 }
2393
2394 /* If we have entries to write, and room for it */
2395 if (Size >= FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask) &&
2396 MaxEntries != 0)
2397 {
2398 /* Already set size we return */
2399 *ReqSize = FIELD_OFFSET(SYSTEM_NUMA_INFORMATION, ActiveProcessorsAffinityMask) +
2400 MaxEntries * sizeof(ULONGLONG);
2401
2402 /* For each node, return processor mask */
2403 for (Node = 0; Node < MaxEntries; ++Node)
2404 {
2406 }
2407 }
2408 else
2409 {
2410 /* We only returned highest node number */
2411 *ReqSize = sizeof(ULONG);
2412 }
2413
2414 return STATUS_SUCCESS;
2415}
KAFFINITY ProcessorMask
Definition: ketypes.h:887
ULONGLONG ActiveProcessorsAffinityMask[MAXIMUM_NUMA_NODES]
Definition: extypes.h:1412

◆ QSI_DEF() [29/55]

QSI_DEF ( SystemObjectInformation  )

Definition at line 1439 of file sysinfo.c.

1440{
1441 /* FIXME */
1442 DPRINT1("NtQuerySystemInformation - SystemObjectInformation not implemented\n");
1444}

◆ QSI_DEF() [30/55]

QSI_DEF ( SystemObjectSecurityMode  )

Definition at line 2627 of file sysinfo.c.

2628{
2629 PULONG ObjectSecurityInfo = (PULONG)Buffer;
2630
2631 /* Validate input size */
2632 if (Size != sizeof(ULONG))
2633 {
2635 }
2636
2637 *ObjectSecurityInfo = ObpObjectSecurityMode;
2638
2639 return STATUS_SUCCESS;
2640}
ULONG ObpObjectSecurityMode
Definition: obinit.c:56

◆ QSI_DEF() [31/55]

Definition at line 1294 of file sysinfo.c.

1295{
1296 /* FIXME */
1297 DPRINT1("NtQuerySystemInformation - SystemPagedPoolInformation not implemented\n");
1299}

◆ QSI_DEF() [32/55]

Definition at line 1447 of file sysinfo.c.

1448{
1449 UNICODE_STRING FileName; /* FIXME */
1451
1452 if (Size < sizeof(SYSTEM_PAGEFILE_INFORMATION))
1453 {
1454 * ReqSize = sizeof(SYSTEM_PAGEFILE_INFORMATION);
1456 }
1457
1458 RtlInitUnicodeString(&FileName, NULL); /* FIXME */
1459
1460 /* FIXME */
1461 Spfi->NextEntryOffset = 0;
1462
1465 Spfi->PeakUsage = MiUsedSwapPages; /* FIXME */
1466 Spfi->PageFileName = FileName;
1467 return STATUS_SUCCESS;
1468}
struct _FileName FileName
Definition: fatprocs.h:897
struct _SYSTEM_PAGEFILE_INFORMATION SYSTEM_PAGEFILE_INFORMATION
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
UNICODE_STRING PageFileName
Definition: extypes.h:1079

◆ QSI_DEF() [33/55]

QSI_DEF ( SystemPathInformation  )

Definition at line 868 of file sysinfo.c.

869{
870 /*
871 * Since NT 3.51, this information class is trivially implemented.
872 * The path to the NT directory is now stored in KUSER_SHARED_DATA
873 * as the NtSystemRoot member.
874 * Windows Checked builds show the following message and break to
875 * the debugger before failing the function as not implemented.
876 */
877#if DBG
878 DPRINT1("EX: SystemPathInformation now available via SharedUserData\n");
879 // DbgBreakPoint(); // Not needed in ReactOS.
880#endif
882}

◆ QSI_DEF() [34/55]

Definition at line 682 of file sysinfo.c.

683{
684 LONG i;
685 ULONG IdleUser, IdleKernel;
686 PKPRCB Prcb;
689
691
692 *ReqSize = sizeof(SYSTEM_PERFORMANCE_INFORMATION);
693
694 /* Check user buffer's size */
696 {
698 }
699
701
702 IdleKernel = KeQueryRuntimeProcess(&TheIdleProcess->Pcb, &IdleUser);
710 for (i = 0; i < KeNumberProcessors; i ++)
711 {
712 Prcb = KiProcessorBlock[i];
713 if (Prcb)
714 {
721 }
722 }
723
725
727 /*
728 * Add up the full system total + pagefile.
729 * All this make Taskmgr happy but not sure it is the right numbers.
730 * This too, fixes some of GlobalMemoryStatusEx numbers.
731 */
733
735 Spi->PageFaultCount = 0; /* FIXME */
736 Spi->CopyOnWriteCount = 0; /* FIXME */
737 Spi->TransitionCount = 0; /* FIXME */
738 Spi->CacheTransitionCount = 0; /* FIXME */
739 Spi->DemandZeroCount = 0; /* FIXME */
740 Spi->PageReadCount = 0; /* FIXME */
741 Spi->PageReadIoCount = 0; /* FIXME */
742 Spi->CacheReadCount = 0; /* FIXME */
743 Spi->CacheIoCount = 0; /* FIXME */
744 Spi->DirtyPagesWriteCount = 0; /* FIXME */
745 Spi->DirtyWriteIoCount = 0; /* FIXME */
746 Spi->MappedPagesWriteCount = 0; /* FIXME */
747 Spi->MappedWriteIoCount = 0; /* FIXME */
748
749 Spi->PagedPoolPages = 0;
750 Spi->NonPagedPoolPages = 0;
751 Spi->PagedPoolAllocs = 0;
752 Spi->PagedPoolFrees = 0;
753 Spi->PagedPoolLookasideHits = 0;
754 Spi->NonPagedPoolAllocs = 0;
755 Spi->NonPagedPoolFrees = 0;
758 &Spi->NonPagedPoolPages,
759 &Spi->PagedPoolAllocs,
760 &Spi->PagedPoolFrees,
762 &Spi->NonPagedPoolAllocs,
763 &Spi->NonPagedPoolFrees,
765 Spi->FreeSystemPtes = 0; /* FIXME */
766
767 Spi->ResidentSystemCodePage = 0; /* FIXME */
768
769 Spi->TotalSystemDriverPages = 0; /* FIXME */
770 Spi->Spare3Count = 0; /* FIXME */
771
773 Spi->ResidentPagedPoolPage = 0; /* FIXME */
774
775 Spi->ResidentSystemDriverPage = 0; /* FIXME */
776 Spi->CcFastReadNoWait = 0; /* FIXME */
777 Spi->CcFastReadWait = 0; /* FIXME */
778 Spi->CcFastReadResourceMiss = 0; /* FIXME */
779 Spi->CcFastReadNotPossible = 0; /* FIXME */
780
781 Spi->CcFastMdlReadNoWait = 0; /* FIXME */
782 Spi->CcFastMdlReadWait = 0; /* FIXME */
783 Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */
784 Spi->CcFastMdlReadNotPossible = 0; /* FIXME */
785
788 Spi->CcMapDataNoWaitMiss = 0; /* FIXME */
789 Spi->CcMapDataWaitMiss = 0; /* FIXME */
790
794 Spi->CcPinReadNoWaitMiss = 0; /* FIXME */
795 Spi->CcPinReadWaitMiss = 0; /* FIXME */
796 Spi->CcCopyReadNoWait = 0; /* FIXME */
797 Spi->CcCopyReadWait = 0; /* FIXME */
798 Spi->CcCopyReadNoWaitMiss = 0; /* FIXME */
799 Spi->CcCopyReadWaitMiss = 0; /* FIXME */
800
801 Spi->CcMdlReadNoWait = 0; /* FIXME */
802 Spi->CcMdlReadWait = 0; /* FIXME */
803 Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */
804 Spi->CcMdlReadWaitMiss = 0; /* FIXME */
805 Spi->CcReadAheadIos = 0; /* FIXME */
810
811 Spi->ContextSwitches = 0;
812 Spi->FirstLevelTbFills = 0;
813 Spi->SecondLevelTbFills = 0;
814 Spi->SystemCalls = 0;
815 for (i = 0; i < KeNumberProcessors; i ++)
816 {
817 Prcb = KiProcessorBlock[i];
818 if (Prcb)
819 {
821 Spi->FirstLevelTbFills += Prcb->KeFirstLevelTbFills;
822 Spi->SecondLevelTbFills += Prcb->KeSecondLevelTbFills;
823 Spi->SystemCalls += Prcb->KeSystemCalls;
824 }
825 }
826
827 return STATUS_SUCCESS;
828}
#define UInt32x32To64(a, b)
Definition: intsafe.h:252
ULONG IoWriteOperationCount
Definition: iomgr.c:41
LARGE_INTEGER IoReadTransferCount
Definition: iomgr.c:40
LARGE_INTEGER IoWriteTransferCount
Definition: iomgr.c:42
ULONG IoOtherOperationCount
Definition: iomgr.c:43
LARGE_INTEGER IoOtherTransferCount
Definition: iomgr.c:44
ULONG IoReadOperationCount
Definition: iomgr.c:39
ULONG CcLazyWritePages
Definition: lazywrite.c:20
ULONG CcLazyWriteIos
Definition: lazywrite.c:21
struct _SYSTEM_PERFORMANCE_INFORMATION * PSYSTEM_PERFORMANCE_INFORMATION
struct _SYSTEM_PERFORMANCE_INFORMATION SYSTEM_PERFORMANCE_INFORMATION
ULONG CcDataPages
Definition: copy.c:43
ULONG CcDataFlushes
Definition: copy.c:44
ULONG CcMapDataWait
Definition: pin.c:28
ULONG CcMapDataNoWait
Definition: pin.c:29
ULONG CcPinReadWait
Definition: pin.c:30
ULONG CcPinMappedDataCount
Definition: pin.c:32
ULONG CcPinReadNoWait
Definition: pin.c:31
VOID NTAPI ExQueryPoolUsage(OUT PULONG PagedPoolPages, OUT PULONG NonPagedPoolPages, OUT PULONG PagedPoolAllocs, OUT PULONG PagedPoolFrees, OUT PULONG PagedPoolLookasideHits, OUT PULONG NonPagedPoolAllocs, OUT PULONG NonPagedPoolFrees, OUT PULONG NonPagedPoolLookasideHits)
Definition: expool.c:1768
ULONG NTAPI KeQueryRuntimeProcess(IN PKPROCESS Process, OUT PULONG UserTime)
Definition: procobj.c:860
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
SIZE_T MmPeakCommitment
Definition: freelist.c:35
LARGE_INTEGER IoReadTransferCount
Definition: ketypes.h:756
LARGE_INTEGER IoOtherTransferCount
Definition: ketypes.h:758
ULONG KeSystemCalls
Definition: ketypes.h:740
LONG IoReadOperationCount
Definition: ketypes.h:753
LONG IoWriteOperationCount
Definition: ketypes.h:754
LONG IoOtherOperationCount
Definition: ketypes.h:755
LARGE_INTEGER IoWriteTransferCount
Definition: ketypes.h:757
LARGE_INTEGER IoOtherTransferCount
Definition: memtest.h:14
LARGE_INTEGER IoWriteTransferCount
Definition: memtest.h:13
LARGE_INTEGER IdleProcessTime
Definition: memtest.h:11
LARGE_INTEGER IoReadTransferCount
Definition: memtest.h:12
LONGLONG QuadPart
Definition: typedefs.h:114

◆ QSI_DEF() [35/55]

Definition at line 1767 of file sysinfo.c.

1768{
1769 /* FIXME */
1770 DPRINT1("NtQuerySystemInformation - SystemPerformanceTraceInformation not implemented\n");
1772}

◆ QSI_DEF() [36/55]

QSI_DEF ( SystemPoolTagInformation  )

Definition at line 1525 of file sysinfo.c.

1526{
1528 return ExGetPoolTagInfo(Buffer, Size, ReqSize);
1529}
NTSTATUS NTAPI ExGetPoolTagInfo(IN PSYSTEM_POOLTAG_INFORMATION SystemInformation, IN ULONG SystemInformationLength, IN OUT PULONG ReturnLength OPTIONAL)
Definition: expool.c:1356

◆ QSI_DEF() [37/55]

Definition at line 2418 of file sysinfo.c.

2419{
2420 /* FIXME */
2421 DPRINT1("NtQuerySystemInformation - SystemPrefetcherInformation not implemented\n");
2423}

◆ QSI_DEF() [38/55]

QSI_DEF ( SystemProcessInformation  )

Definition at line 885 of file sysinfo.c.

886{
889 PEPROCESS Process = NULL, SystemProcess;
890 PETHREAD CurrentThread;
892 ULONG CurrentSize;
893 USHORT ImageNameMaximumLength; // image name length in bytes
894 USHORT ImageNameLength;
895 PLIST_ENTRY CurrentEntry;
896 ULONG TotalSize = 0, ThreadsCount;
897 ULONG TotalUser, TotalKernel;
898 PUCHAR Current;
900 PUNICODE_STRING TempProcessImageName;
901 _SEH2_VOLATILE PUNICODE_STRING ProcessImageName = NULL;
902 PWCHAR szSrc;
903 BOOLEAN Overflow = FALSE;
904
906 {
907 /* scan the process list */
908
911
912 *ReqSize = sizeof(SYSTEM_PROCESS_INFORMATION);
913
914 /* Check for overflow */
915 if (Size < sizeof(SYSTEM_PROCESS_INFORMATION))
916 {
917 Overflow = TRUE;
918 }
919
920 /* Zero user's buffer */
921 if (!Overflow) RtlZeroMemory(Spi, Size);
922
923 SystemProcess = PsIdleProcess;
924 Process = SystemProcess;
925 Current = (PUCHAR) Spi;
926
927 do
928 {
929 SpiCurrent = (PSYSTEM_PROCESS_INFORMATION) Current;
930
931 /* Lock the Process */
933 ExAcquirePushLockShared(&Process->ProcessLock);
934
935 if ((Process->ProcessExiting) &&
936 (Process->Pcb.Header.SignalState) &&
937 !(Process->ActiveThreads) &&
938 (IsListEmpty(&Process->Pcb.ThreadListHead)))
939 {
940 DPRINT1("Process %p (%s:%p) is a zombie\n",
941 Process, Process->ImageFileName, Process->UniqueProcessId);
942 CurrentSize = 0;
943 ImageNameMaximumLength = 0;
944
945 /* Unlock the Process */
946 ExReleasePushLockShared(&Process->ProcessLock);
948 goto Skip;
949 }
950
951 ThreadsCount = 0;
952 CurrentEntry = Process->Pcb.ThreadListHead.Flink;
953 while (CurrentEntry != &Process->Pcb.ThreadListHead)
954 {
955 ThreadsCount++;
956 CurrentEntry = CurrentEntry->Flink;
957 }
958
959 // size of the structure for every process
960 CurrentSize = sizeof(SYSTEM_PROCESS_INFORMATION) + sizeof(SYSTEM_THREAD_INFORMATION) * ThreadsCount;
961 ImageNameLength = 0;
962 Status = SeLocateProcessImageName(Process, &TempProcessImageName);
963 ProcessImageName = TempProcessImageName;
964 szSrc = NULL;
965 if (NT_SUCCESS(Status) && (ProcessImageName->Length > 0))
966 {
967 szSrc = (PWCHAR)((PCHAR)ProcessImageName->Buffer + ProcessImageName->Length);
968 /* Loop the file name*/
969 while (szSrc > ProcessImageName->Buffer)
970 {
971 /* Make sure this isn't a backslash */
972 if (*--szSrc == OBJ_NAME_PATH_SEPARATOR)
973 {
974 szSrc++;
975 break;
976 }
977 else
978 {
979 ImageNameLength += sizeof(WCHAR);
980 }
981 }
982 }
983 if (!ImageNameLength && Process != PsIdleProcess)
984 {
985 ImageNameLength = (USHORT)strlen(Process->ImageFileName) * sizeof(WCHAR);
986 }
987
988 /* Round up the image name length as NT does */
989 if (ImageNameLength > 0)
990 ImageNameMaximumLength = ROUND_UP(ImageNameLength + sizeof(WCHAR), 8);
991 else
992 ImageNameMaximumLength = 0;
993
994 TotalSize += CurrentSize + ImageNameMaximumLength;
995
996 /* Check for overflow */
997 if (TotalSize > Size)
998 {
999 Overflow = TRUE;
1000 }
1001
1002 /* Fill system information */
1003 if (!Overflow)
1004 {
1005 SpiCurrent->NextEntryOffset = CurrentSize + ImageNameMaximumLength; // relative offset to the beginning of the next structure
1006 SpiCurrent->NumberOfThreads = ThreadsCount;
1007 SpiCurrent->CreateTime = Process->CreateTime;
1008 SpiCurrent->ImageName.Length = ImageNameLength;
1009 SpiCurrent->ImageName.MaximumLength = ImageNameMaximumLength;
1010 SpiCurrent->ImageName.Buffer = (void*)(Current + CurrentSize);
1011
1012 /* Copy name to the end of the struct */
1013 if(Process != PsIdleProcess)
1014 {
1015 if (szSrc)
1016 {
1017 RtlCopyMemory(SpiCurrent->ImageName.Buffer, szSrc, SpiCurrent->ImageName.Length);
1018 }
1019 else
1020 {
1021 RtlInitAnsiString(&ImageName, Process->ImageFileName);
1023 if (!NT_SUCCESS(Status))
1024 {
1025 SpiCurrent->ImageName.Length = 0;
1026 }
1027 }
1028 }
1029 else
1030 {
1031 RtlInitUnicodeString(&SpiCurrent->ImageName, NULL);
1032 }
1033
1034 SpiCurrent->BasePriority = Process->Pcb.BasePriority;
1035 SpiCurrent->UniqueProcessId = Process->UniqueProcessId;
1036 SpiCurrent->InheritedFromUniqueProcessId = Process->InheritedFromUniqueProcessId;
1037
1038 /* PsIdleProcess shares its handle table with PsInitialSystemProcess,
1039 * so return the handle count for System only, not Idle one. */
1041
1042 SpiCurrent->PeakVirtualSize = Process->PeakVirtualSize;
1043 SpiCurrent->VirtualSize = Process->VirtualSize;
1044 SpiCurrent->PageFaultCount = Process->Vm.PageFaultCount;
1045 SpiCurrent->PeakWorkingSetSize = Process->Vm.PeakWorkingSetSize;
1046 SpiCurrent->WorkingSetSize = Process->Vm.WorkingSetSize;
1047 SpiCurrent->QuotaPeakPagedPoolUsage = Process->QuotaPeak[PsPagedPool];
1048 SpiCurrent->QuotaPagedPoolUsage = Process->QuotaUsage[PsPagedPool];
1049 SpiCurrent->QuotaPeakNonPagedPoolUsage = Process->QuotaPeak[PsNonPagedPool];
1050 SpiCurrent->QuotaNonPagedPoolUsage = Process->QuotaUsage[PsNonPagedPool];
1051 SpiCurrent->PagefileUsage = Process->QuotaUsage[PsPageFile];
1052 SpiCurrent->PeakPagefileUsage = Process->QuotaPeak[PsPageFile];
1053 SpiCurrent->PrivatePageCount = Process->CommitCharge;
1054 ThreadInfo = (PSYSTEM_THREAD_INFORMATION)(SpiCurrent + 1);
1055
1056 CurrentEntry = Process->Pcb.ThreadListHead.Flink;
1057 while (CurrentEntry != &Process->Pcb.ThreadListHead)
1058 {
1059 CurrentThread = CONTAINING_RECORD(CurrentEntry, ETHREAD, Tcb.ThreadListEntry);
1060
1061 ThreadInfo->KernelTime.QuadPart = UInt32x32To64(CurrentThread->Tcb.KernelTime, KeMaximumIncrement);
1062 ThreadInfo->UserTime.QuadPart = UInt32x32To64(CurrentThread->Tcb.UserTime, KeMaximumIncrement);
1063 ThreadInfo->CreateTime.QuadPart = CurrentThread->CreateTime.QuadPart;
1064 ThreadInfo->WaitTime = CurrentThread->Tcb.WaitTime;
1065 ThreadInfo->StartAddress = (PVOID) CurrentThread->StartAddress;
1066 ThreadInfo->ClientId = CurrentThread->Cid;
1067 ThreadInfo->Priority = CurrentThread->Tcb.Priority;
1068 ThreadInfo->BasePriority = CurrentThread->Tcb.BasePriority;
1069 ThreadInfo->ContextSwitches = CurrentThread->Tcb.ContextSwitches;
1070 ThreadInfo->ThreadState = CurrentThread->Tcb.State;
1071 ThreadInfo->WaitReason = CurrentThread->Tcb.WaitReason;
1072
1073 ThreadInfo++;
1074 CurrentEntry = CurrentEntry->Flink;
1075 }
1076
1077 /* Query total user/kernel times of a process */
1078 TotalKernel = KeQueryRuntimeProcess(&Process->Pcb, &TotalUser);
1079 SpiCurrent->UserTime.QuadPart = UInt32x32To64(TotalUser, KeMaximumIncrement);
1080 SpiCurrent->KernelTime.QuadPart = UInt32x32To64(TotalKernel, KeMaximumIncrement);
1081 }
1082
1083 if (ProcessImageName)
1084 {
1085 /* Release the memory allocated by SeLocateProcessImageName */
1086 ExFreePoolWithTag(ProcessImageName, TAG_SEPA);
1087 ProcessImageName = NULL;
1088 }
1089
1090 /* Unlock the Process */
1091 ExReleasePushLockShared(&Process->ProcessLock);
1093
1094 /* Handle idle process entry */
1095Skip:
1097
1099 ThreadsCount = 0;
1100 if ((Process == SystemProcess) || (Process == NULL))
1101 {
1102 if (!Overflow)
1103 SpiCurrent->NextEntryOffset = 0;
1104 break;
1105 }
1106 else
1107 Current += CurrentSize + ImageNameMaximumLength;
1108 } while ((Process != SystemProcess) && (Process != NULL));
1109
1110 if(Process != NULL)
1113 }
1115 {
1116 if(Process != NULL)
1118 if (ProcessImageName)
1119 {
1120 /* Release the memory allocated by SeLocateProcessImageName */
1121 ExFreePoolWithTag(ProcessImageName, TAG_SEPA);
1122 }
1123
1125 }
1126 _SEH2_END
1127
1128 if (Overflow)
1130
1131 *ReqSize = TotalSize;
1132 return Status;
1133}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ROUND_UP(n, align)
Definition: eventvwr.h:34
@ PsNonPagedPool
Definition: pstypes.h:1022
@ PsPageFile
Definition: pstypes.h:1024
@ PsPagedPool
Definition: pstypes.h:1023
struct _ThreadInfo ThreadInfo
static const char * ImageName
Definition: image.c:34
struct _SYSTEM_THREAD_INFORMATION * PSYSTEM_THREAD_INFORMATION
struct _SYSTEM_PROCESS_INFORMATION * PSYSTEM_PROCESS_INFORMATION
struct _SYSTEM_PROCESS_INFORMATION SYSTEM_PROCESS_INFORMATION
NTSTATUS NTAPI SeLocateProcessImageName(_In_ PEPROCESS Process, _Out_ PUNICODE_STRING *ProcessImageName)
Finds the process image name of a specific process.
Definition: audit.c:199
ULONG NTAPI ObGetProcessHandleCount(IN PEPROCESS Process)
Definition: obhandle.c:56
PEPROCESS NTAPI PsGetNextProcess(IN PEPROCESS OldProcess OPTIONAL)
Definition: process.c:128
#define _SEH2_VOLATILE
Definition: pseh2_64.h:169
STDMETHOD() Skip(THIS_ ULONG celt) PURE
PKSTART_ROUTINE StartAddress
Definition: pstypes.h:1156
KTHREAD Tcb
Definition: pstypes.h:1104
CLIENT_ID Cid
Definition: pstypes.h:1129
LARGE_INTEGER CreateTime
Definition: pstypes.h:1105
LIST_ENTRY ThreadListEntry
Definition: pstypes.h:1159
SCHAR Priority
Definition: ketypes.h:1782
ULONG KernelTime
Definition: ketypes.h:1987
CHAR BasePriority
Definition: ketypes.h:1917
ULONG WaitTime
Definition: ketypes.h:1875
UCHAR WaitReason
Definition: ketypes.h:1964
ULONG ContextSwitches
Definition: ketypes.h:1788
ULONG UserTime
Definition: ketypes.h:2003
volatile UCHAR State
Definition: ketypes.h:1789
LARGE_INTEGER UserTime
Definition: extypes.h:904
UNICODE_STRING ImageName
Definition: extypes.h:906
LARGE_INTEGER CreateTime
Definition: extypes.h:903
LARGE_INTEGER KernelTime
Definition: extypes.h:905
HANDLE InheritedFromUniqueProcessId
Definition: extypes.h:909
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TAG_SEPA
Definition: tag.h:155
void * PVOID
Definition: typedefs.h:50
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint16_t * PWCHAR
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
#define ObDereferenceObject
Definition: obfuncs.h:203

◆ QSI_DEF() [39/55]

QSI_DEF ( SystemProcessorIdleInformation  )

Definition at line 2051 of file sysinfo.c.

2052{
2054
2056 {
2058 }
2059
2060 /* FIXME */
2061 DPRINT1("NtQuerySystemInformation - SystemPowerInformation not implemented\n");
2063}
struct _PROCESSOR_POWER_INFORMATION PROCESSOR_POWER_INFORMATION

◆ QSI_DEF() [40/55]

Definition at line 647 of file sysinfo.c.

648{
651
652 *ReqSize = sizeof(SYSTEM_PROCESSOR_INFORMATION);
653
654 /* Check user buffer's size */
656 {
658 }
662#if (NTDDI_VERSION < NTDDI_WIN8)
663 Spi->Reserved = 0;
664#else
665 Spi->MaximumProcessors = 0;
666#endif
667
668 /* According to Geoff Chappell, on Win 8.1 x64 / Win 10 x86, where this
669 field is extended to 64 bits, it continues to produce only the low 32
670 bits. For the full value, use SYSTEM_PROCESSOR_FEATURES_INFORMATION.
671 See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/processor.htm
672 */
674
675 DPRINT("Arch %u Level %u Rev 0x%x\n", Spi->ProcessorArchitecture,
677
678 return STATUS_SUCCESS;
679}
struct _SYSTEM_PROCESSOR_INFORMATION * PSYSTEM_PROCESSOR_INFORMATION
struct _SYSTEM_PROCESSOR_INFORMATION SYSTEM_PROCESSOR_INFORMATION
ULONG64 KeFeatureBits
Definition: krnlinit.c:22
USHORT KeProcessorLevel
Definition: krnlinit.c:20
USHORT KeProcessorRevision
Definition: krnlinit.c:21
USHORT KeProcessorArchitecture
Definition: krnlinit.c:19

◆ QSI_DEF() [41/55]

Definition at line 1171 of file sysinfo.c.

1172{
1175
1176 LONG i;
1177 ULONG TotalTime;
1178 PKPRCB Prcb;
1179
1181
1182 /* Check user buffer's size */
1183 if (Size < *ReqSize)
1184 {
1186 }
1187
1188 for (i = 0; i < KeNumberProcessors; i++)
1189 {
1190 /* Get the PRCB on this processor */
1191 Prcb = KiProcessorBlock[i];
1192
1193 /* Calculate total user and kernel times */
1194 TotalTime = Prcb->IdleThread->KernelTime + Prcb->IdleThread->UserTime;
1200 Spi->InterruptCount = Prcb->InterruptCount;
1201 Spi++;
1202 }
1203
1204 return STATUS_SUCCESS;
1205}
struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION * PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
ULONG InterruptTime
Definition: ketypes.h:829
ULONG InterruptCount
Definition: ketypes.h:825
ULONG DpcTime
Definition: ketypes.h:828

◆ QSI_DEF() [42/55]

Definition at line 2320 of file sysinfo.c.

2321{
2322 /* Check user buffer's size */
2323 if (Size != sizeof(ULONG_PTR)) return STATUS_INFO_LENGTH_MISMATCH;
2324
2326
2327 if (ReqSize) *ReqSize = sizeof(ULONG_PTR);
2328
2329 return STATUS_SUCCESS;
2330}
#define MmSystemRangeStart
Definition: mm.h:32
uint32_t * PULONG_PTR
Definition: typedefs.h:65

◆ QSI_DEF() [43/55]

Definition at line 2434 of file sysinfo.c.

2435{
2436 /* FIXME */
2437 DPRINT1("NtQuerySystemInformation - SystemRecommendedSharedDataAlignment not implemented\n");
2439}

◆ QSI_DEF() [44/55]

Definition at line 1894 of file sysinfo.c.

1895{
1897
1898 *ReqSize = sizeof(SYSTEM_REGISTRY_QUOTA_INFORMATION);
1900 {
1902 }
1903
1904 DPRINT1("Faking max registry size of 32 MB\n");
1905 srqi->RegistryQuotaAllowed = 0x2000000;
1906 srqi->RegistryQuotaUsed = 0x200000;
1907 srqi->PagedPoolSize = 0x200000;
1908
1909 return STATUS_SUCCESS;
1910}
struct _SYSTEM_REGISTRY_QUOTA_INFORMATION SYSTEM_REGISTRY_QUOTA_INFORMATION
struct _SYSTEM_REGISTRY_QUOTA_INFORMATION * PSYSTEM_REGISTRY_QUOTA_INFORMATION

◆ QSI_DEF() [45/55]

QSI_DEF ( SystemSessionInformation  )

Definition at line 2312 of file sysinfo.c.

2313{
2314 /* FIXME */
2315 DPRINT1("NtQuerySystemInformation - SystemSessionInformation not implemented\n");
2317}

◆ QSI_DEF() [46/55]

Definition at line 2356 of file sysinfo.c.

2357{
2358 /* FIXME */
2359 DPRINT1("NtQuerySystemInformation - SystemSessionProcessInformation not implemented\n");
2361}

◆ QSI_DEF() [47/55]

Definition at line 1286 of file sysinfo.c.

1287{
1288 /* FIXME */
1289 DPRINT1("NtQuerySystemInformation - SystemStackTraceInformation not implemented\n");
1291}

◆ QSI_DEF() [48/55]

Definition at line 1751 of file sysinfo.c.

1752{
1753 /* FIXME */
1754 DPRINT1("NtQuerySystemInformation - SystemSummaryMemoryInformation not implemented\n");
1756}

◆ QSI_DEF() [49/55]

Definition at line 1690 of file sysinfo.c.

1691{
1694
1695 /* Check if enough storage was provided */
1697 {
1698 * ReqSize = sizeof(SYSTEM_QUERY_TIME_ADJUST_INFORMATION);
1700 }
1701
1702 /* Give time values to our caller */
1704 TimeInfo->TimeAdjustment = KeTimeAdjustment;
1705 TimeInfo->Enable = !KiTimeAdjustmentEnabled;
1706
1707 return STATUS_SUCCESS;
1708}
struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION * PSYSTEM_QUERY_TIME_ADJUST_INFORMATION
struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION SYSTEM_QUERY_TIME_ADJUST_INFORMATION
BOOLEAN KiTimeAdjustmentEnabled
Definition: time.c:19
ULONG KeTimeAdjustment
Definition: time.c:18

◆ QSI_DEF() [50/55]

Definition at line 831 of file sysinfo.c.

832{
834 LARGE_INTEGER CurrentTime;
835
836 /* Set amount of written information to 0 */
837 *ReqSize = 0;
838
839 /* Check user buffer's size */
841 {
843 }
844
845 /* Get current time */
846 KeQuerySystemTime(&CurrentTime);
847
848 /* Zero local buffer */
850
851 /* Fill local time structure */
852 Sti.BootTime= KeBootTime;
853 Sti.CurrentTime = CurrentTime;
856 Sti.Reserved = 0;
857
858 /* Copy as much as requested by caller */
859 RtlCopyMemory(Buffer, &Sti, Size);
860
861 /* Set amount of information we copied */
862 *ReqSize = Size;
863
864 return STATUS_SUCCESS;
865}
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
LARGE_INTEGER ExpTimeZoneBias
Definition: time.c:23
ULONG ExpTimeZoneId
Definition: time.c:25
LARGE_INTEGER KeBootTime
Definition: clock.c:17
LARGE_INTEGER TimeZoneBias
Definition: extypes.h:863
LARGE_INTEGER CurrentTime
Definition: extypes.h:862

◆ QSI_DEF() [51/55]

QSI_DEF ( SystemVdmBopInformation  )

Definition at line 1479 of file sysinfo.c.

1480{
1481 /* FIXME */
1482 DPRINT1("NtQuerySystemInformation - SystemVdmBopInformation not implemented\n");
1484}

◆ QSI_DEF() [52/55]

Definition at line 1471 of file sysinfo.c.

1472{
1473 /* FIXME */
1474 DPRINT1("NtQuerySystemInformation - SystemVdmInstemulInformation not implemented\n");
1476}

◆ QSI_DEF() [53/55]

QSI_DEF ( SystemVerifierAddDriverInformation  )

Definition at line 2035 of file sysinfo.c.

2036{
2037 /* FIXME */
2038 DPRINT1("NtQuerySystemInformation - SystemVerifierAddDriverInformation not implemented\n");
2040}

◆ QSI_DEF() [54/55]

Definition at line 2333 of file sysinfo.c.

2334{
2335 /* FIXME */
2336 DPRINT1("NtQuerySystemInformation - SystemVerifierInformation not implemented\n");
2338}

◆ QSI_DEF() [55/55]

QSI_DEF ( SystemVerifierRemoveDriverInformation  )

Definition at line 2043 of file sysinfo.c.

2044{
2045 /* FIXME */
2046 DPRINT1("NtQuerySystemInformation - SystemVerifierRemoveDriverInformation not implemented\n");
2048}

◆ SSI_DEF() [1/16]

Definition at line 2091 of file sysinfo.c.

2092{
2093 /* Check user buffer's size */
2094 if (Size < sizeof(RTL_TIME_ZONE_INFORMATION))
2095 {
2097 }
2098
2100}
NTSTATUS ExpSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
Definition: time.c:361

◆ SSI_DEF() [2/16]

Definition at line 1579 of file sysinfo.c.

1580{
1581 /* FIXME */
1582 DPRINT1("NtSetSystemInformation - SystemDpcBehaviourInformation not implemented\n");
1584}

◆ SSI_DEF() [3/16]

Definition at line 1920 of file sysinfo.c.

1921{
1924 PLDR_DATA_TABLE_ENTRY ModuleObject;
1926 PIMAGE_NT_HEADERS NtHeader;
1927 DRIVER_OBJECT Win32k;
1928 PDRIVER_INITIALIZE DriverInit;
1929 PVOID ImageBase;
1930 ULONG_PTR EntryPoint;
1931
1932 /* Validate the size */
1933 if (Size != sizeof(UNICODE_STRING)) return STATUS_INFO_LENGTH_MISMATCH;
1934
1935 /* Check who is calling */
1936 if (PreviousMode != KernelMode)
1937 {
1938 static const UNICODE_STRING Win32kName =
1939 RTL_CONSTANT_STRING(L"\\SystemRoot\\System32\\win32k.sys");
1940
1941 /* Make sure we can load drivers */
1943 {
1944 /* FIXME: We can't, fail */
1946 }
1947
1948 _SEH2_TRY
1949 {
1950 /* Probe and copy the unicode string */
1951 ProbeForRead(Buffer, sizeof(ImageName), 1);
1953
1954 /* Probe the string buffer */
1955 ProbeForRead(ImageName.Buffer, ImageName.Length, sizeof(WCHAR));
1956
1957 /* Check if we have the correct name (nothing else is allowed!) */
1958 if (!RtlEqualUnicodeString(&ImageName, &Win32kName, FALSE))
1959 {
1961 }
1962 }
1964 {
1966 }
1967 _SEH2_END;
1968
1969 /* Recursively call the function, so that we are from kernel mode */
1971 (PVOID)&Win32kName,
1972 sizeof(Win32kName));
1973 }
1974
1975 /* Load the image */
1977 NULL,
1978 NULL,
1979 0,
1980 (PVOID)&ModuleObject,
1981 &ImageBase);
1982
1983 if (!NT_SUCCESS(Status)) return Status;
1984
1985 /* Get the headers */
1986 NtHeader = RtlImageNtHeader(ImageBase);
1987 if (!NtHeader)
1988 {
1989 /* Fail */
1990 MmUnloadSystemImage(ModuleObject);
1992 }
1993
1994 /* Get the entrypoint */
1995 EntryPoint = NtHeader->OptionalHeader.AddressOfEntryPoint;
1996 EntryPoint += (ULONG_PTR)ImageBase;
1997 DriverInit = (PDRIVER_INITIALIZE)EntryPoint;
1998
1999 /* Create a dummy device */
2000 RtlZeroMemory(&Win32k, sizeof(Win32k));
2002 Win32k.DriverStart = ImageBase;
2003
2004 /* Call it */
2005 Status = (DriverInit)(&Win32k, NULL);
2007
2008 /* Unload if we failed */
2009 if (!NT_SUCCESS(Status)) MmUnloadSystemImage(ModuleObject);
2010 return Status;
2011}
#define SystemExtendServiceTableInformation
Definition: DriverTester.h:35
#define RtlImageNtHeader
Definition: compat.h:806
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
NTSYSAPI NTSTATUS NTAPI ZwSetSystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _In_reads_bytes_(SystemInformationLength) PVOID SystemInformation, _In_ ULONG SystemInformationLength)
#define UserMode
Definition: asm.h:39
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
NTSTATUS NTAPI MmLoadSystemImage(IN PUNICODE_STRING FileName, IN PUNICODE_STRING NamePrefix OPTIONAL, IN PUNICODE_STRING LoadedName OPTIONAL, IN ULONG Flags, OUT PVOID *ModuleObject, OUT PVOID *ImageBaseAddress)
Definition: sysldr.c:2949
NTSTATUS NTAPI MmUnloadSystemImage(IN PVOID ImageHandle)
Definition: sysldr.c:945
const LUID SeLoadDriverPrivilege
Definition: priv.c:29
#define STATUS_INVALID_IMAGE_FORMAT
Definition: ntstatus.h:359
#define L(x)
Definition: ntvdm.h:50
PVOID DriverStart
Definition: iotypes.h:2279
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
DRIVER_INITIALIZE * PDRIVER_INITIALIZE
Definition: iotypes.h:2235

◆ SSI_DEF() [4/16]

Definition at line 1513 of file sysinfo.c.

1514{
1515 if (Size < sizeof(SYSTEM_FILECACHE_INFORMATION))
1516 {
1518 }
1519 /* FIXME */
1520 DPRINT1("NtSetSystemInformation - SystemFileCacheInformation not implemented\n");
1522}

◆ SSI_DEF() [5/16]

SSI_DEF ( SystemFlagsInformation  )

Definition at line 1227 of file sysinfo.c.

1228{
1229 if (sizeof(SYSTEM_FLAGS_INFORMATION) != Size)
1230 {
1232 }
1233
1235 {
1236#if (NTDDI_VERSION < NTDDI_WIN7)
1238#else
1239 return STATUS_ACCESS_DENIED;
1240#endif
1241 }
1242
1244 return STATUS_SUCCESS;
1245}
const LUID SeDebugPrivilege
Definition: priv.c:39
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145

◆ SSI_DEF() [6/16]

Definition at line 1616 of file sysinfo.c.

1617{
1620 PVOID ImageBase;
1621 PVOID SectionPointer;
1622 ULONG_PTR EntryPoint;
1624 ULONG DirSize;
1625 PIMAGE_NT_HEADERS NtHeader;
1626
1627 /* Validate size */
1628 if (Size != sizeof(SYSTEM_GDI_DRIVER_INFORMATION))
1629 {
1630 /* Incorrect buffer length, fail */
1632 }
1633
1634 /* Only kernel mode can call this function */
1636
1637 /* Load the driver */
1638 ImageName = DriverInfo->DriverName;
1640 NULL,
1641 NULL,
1642 0,
1643 &SectionPointer,
1644 &ImageBase);
1645 if (!NT_SUCCESS(Status)) return Status;
1646
1647 /* Return the export pointer */
1648 DriverInfo->ExportSectionPointer =
1650 TRUE,
1652 &DirSize);
1653
1654 /* Get the entrypoint */
1655 NtHeader = RtlImageNtHeader(ImageBase);
1656 EntryPoint = NtHeader->OptionalHeader.AddressOfEntryPoint;
1657 EntryPoint += (ULONG_PTR)ImageBase;
1658
1659 /* Save other data */
1660 DriverInfo->ImageAddress = ImageBase;
1661 DriverInfo->SectionPointer = SectionPointer;
1662 DriverInfo->EntryPoint = (PVOID)EntryPoint;
1663 DriverInfo->ImageLength = NtHeader->OptionalHeader.SizeOfImage;
1664
1665 /* All is good */
1666 return STATUS_SUCCESS;
1667}
#define IMAGE_DIRECTORY_ENTRY_EXPORT
Definition: compat.h:151
#define RtlImageDirectoryEntryToData
Definition: compat.h:809
DRIVER_INFORMATION DriverInfo
Definition: main.c:59

◆ SSI_DEF() [7/16]

Definition at line 2364 of file sysinfo.c.

2365{
2366 /* FIXME */
2367 DPRINT1("NtSetSystemInformation - SystemLoadGdiDriverInSystemSpaceInformation not implemented\n");
2369}

◆ SSI_DEF() [8/16]

SSI_DEF ( SystemPrioritySeperation  )

Definition at line 2014 of file sysinfo.c.

2015{
2016 /* Check if the size is correct */
2017 if (Size != sizeof(ULONG))
2018 {
2020 }
2021
2022 /* We need the TCB privilege */
2024 {
2026 }
2027
2028 /* Modify the quantum table */
2030
2031 return STATUS_SUCCESS;
2032}
const LUID SeTcbPrivilege
Definition: priv.c:26
VOID NTAPI PsChangeQuantumTable(IN BOOLEAN Immediate, IN ULONG PrioritySeparation)
Definition: process.c:235

◆ SSI_DEF() [9/16]

Definition at line 1912 of file sysinfo.c.

1913{
1914 /* FIXME */
1915 DPRINT1("NtSetSystemInformation - SystemRegistryQuotaInformation not implemented\n");
1917}

◆ SSI_DEF() [10/16]

SSI_DEF ( SystemSessionCreate  )

Definition at line 2266 of file sysinfo.c.

2267{
2271
2272 if (Size != sizeof(ULONG)) return STATUS_INFO_LENGTH_MISMATCH;
2273
2274 if (PreviousMode != KernelMode)
2275 {
2277 {
2279 }
2280
2282 }
2283
2286
2287 return Status;
2288}
NTSTATUS NTAPI MmSessionCreate(OUT PULONG SessionId)
Definition: session.c:827

◆ SSI_DEF() [11/16]

SSI_DEF ( SystemSessionDetach  )

Definition at line 2291 of file sysinfo.c.

2292{
2295
2296 if (Size != sizeof(ULONG)) return STATUS_INFO_LENGTH_MISMATCH;
2297
2298 if (PreviousMode != KernelMode)
2299 {
2301 {
2303 }
2304 }
2305
2307
2308 return MmSessionDelete(SessionId);
2309}
NTSTATUS NTAPI MmSessionDelete(IN ULONG SessionId)
Definition: session.c:887

◆ SSI_DEF() [12/16]

Definition at line 1710 of file sysinfo.c.

1711{
1715
1716 /* Check size of a buffer, it must match our expectations */
1719
1720 /* Check who is calling */
1721 if (PreviousMode != KernelMode)
1722 {
1723 /* Check access rights */
1725 {
1727 }
1728 }
1729
1730 /* FIXME: behaviour suggests the member be named 'Disable' */
1731 if (TimeInfo->Enable)
1732 {
1733 /* Disable time adjustment and set default value */
1736 }
1737 else
1738 {
1739 /* Check if a valid time adjustment value is given */
1740 if (TimeInfo->TimeAdjustment == 0) return STATUS_INVALID_PARAMETER_2;
1741
1742 /* Enable time adjustment and set the adjustment value */
1744 KeTimeAdjustment = TimeInfo->TimeAdjustment;
1745 }
1746
1747 return STATUS_SUCCESS;
1748}
struct _SYSTEM_SET_TIME_ADJUST_INFORMATION * PSYSTEM_SET_TIME_ADJUST_INFORMATION
const LUID SeSystemtimePrivilege
Definition: priv.c:31
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476

◆ SSI_DEF() [13/16]

Definition at line 2250 of file sysinfo.c.

2251{
2252 /* FIXME */
2253 DPRINT1("NtSetSystemInformation - SystemTimeSlipNotification not implemented\n");
2255}

◆ SSI_DEF() [14/16]

Definition at line 1670 of file sysinfo.c.

1671{
1672 PVOID *SectionPointer = Buffer;
1673
1674 /* Validate size */
1675 if (Size != sizeof(PVOID))
1676 {
1677 /* Incorrect length, fail */
1679 }
1680
1681 /* Only kernel mode can call this function */
1683
1684 /* Unload the image */
1685 MmUnloadSystemImage(*SectionPointer);
1686 return STATUS_SUCCESS;
1687}

◆ SSI_DEF() [15/16]

Definition at line 2340 of file sysinfo.c.

2341{
2342 /* FIXME */
2343 DPRINT1("NtSetSystemInformation - SystemVerifierInformation not implemented\n");
2345}

◆ SSI_DEF() [16/16]

SSI_DEF ( SystemVerifierThunkExtend  )

Definition at line 2348 of file sysinfo.c.

2349{
2350 /* FIXME */
2351 DPRINT1("NtSetSystemInformation - SystemVerifierThunkExtend not implemented\n");
2353}

Variable Documentation

◆ CallQS

QSSI_CALLS CallQS[]
static

Definition at line 2846 of file sysinfo.c.

Referenced by NtQuerySystemInformation(), and NtSetSystemInformation().

◆ ExpEnvironmentLock

FAST_MUTEX ExpEnvironmentLock

Definition at line 29 of file sysinfo.c.

Referenced by ExpInitSystemPhase0().

◆ ExpFirmwareTableProviderListHead

LIST_ENTRY ExpFirmwareTableProviderListHead

Definition at line 31 of file sysinfo.c.

Referenced by ExpInitSystemPhase0().

◆ ExpFirmwareTableResource

ERESOURCE ExpFirmwareTableResource

Definition at line 30 of file sysinfo.c.

Referenced by ExpInitSystemPhase0().

◆ HandleTableListHead

LIST_ENTRY HandleTableListHead
extern

Definition at line 18 of file handle.c.

Referenced by ExCreateHandleTable(), ExDupHandleTable(), ExpInitializeHandleTables(), and QSI_DEF().

◆ HandleTableListLock

EX_PUSH_LOCK HandleTableListLock
extern