ReactOS  0.4.14-dev-606-g14ebc0b
sysinfo.c File Reference
#include <k32.h>
#include <debug.h>
Include dependency graph for sysinfo.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define PV_NT351   0x00030033
 

Functions

VOID WINAPI GetSystemInfoInternal (IN PSYSTEM_BASIC_INFORMATION BasicInfo, IN PSYSTEM_PROCESSOR_INFORMATION ProcInfo, OUT LPSYSTEM_INFO SystemInfo)
 
static UINT BaseQuerySystemFirmware (IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize, IN SYSTEM_FIRMWARE_TABLE_ACTION Action)
 
SIZE_T WINAPI GetLargePageMinimum (VOID)
 
VOID WINAPI GetSystemInfo (IN LPSYSTEM_INFO lpSystemInfo)
 
BOOL WINAPI IsProcessorFeaturePresent (IN DWORD ProcessorFeature)
 
BOOL WINAPI GetSystemRegistryQuota (OUT PDWORD pdwQuotaAllowed, OUT PDWORD pdwQuotaUsed)
 
VOID WINAPI GetNativeSystemInfo (IN LPSYSTEM_INFO lpSystemInfo)
 
BOOL WINAPI GetLogicalProcessorInformation (OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer, IN OUT PDWORD ReturnLength)
 
BOOL WINAPI GetNumaHighestNodeNumber (OUT PULONG HighestNodeNumber)
 
BOOL WINAPI GetNumaNodeProcessorMask (IN UCHAR Node, OUT PULONGLONG ProcessorMask)
 
BOOL WINAPI GetNumaProcessorNode (IN UCHAR Processor, OUT PUCHAR NodeNumber)
 
BOOL WINAPI GetNumaAvailableMemoryNode (IN UCHAR Node, OUT PULONGLONG AvailableBytes)
 
DWORD WINAPI GetFirmwareEnvironmentVariableW (IN LPCWSTR lpName, IN LPCWSTR lpGuid, IN PVOID pValue, IN DWORD nSize)
 
BOOL WINAPI SetFirmwareEnvironmentVariableW (IN LPCWSTR lpName, IN LPCWSTR lpGuid, IN PVOID pValue, IN DWORD nSize)
 
DWORD WINAPI GetFirmwareEnvironmentVariableA (IN LPCSTR lpName, IN LPCSTR lpGuid, IN PVOID pValue, IN DWORD nSize)
 
BOOL WINAPI SetFirmwareEnvironmentVariableA (IN LPCSTR lpName, IN LPCSTR lpGuid, IN PVOID pValue, IN DWORD nSize)
 
EnumSystemFirmwareTables

@implemented

Obtains firmware table identifiers. https://msdn.microsoft.com/en-us/library/windows/desktop/ms724259(v=vs.85).aspx

Parameters
FirmwareTableProviderSignatureCan be either ACPI, FIRM, or RSMB.
pFirmwareTableBufferPointer to the output buffer, can be NULL.
BufferSizeSize of the output buffer.
Returns
Actual size of the data in case of success, 0 otherwise.
Remarks
Data would be written to buffer only if the specified size is larger or equal to the actual size, in the other case Last Error value would be set to ERROR_INSUFFICIENT_BUFFER. In case of incorrect provider signature, Last Error value would be set to ERROR_INVALID_FUNCTION.
UINT WINAPI EnumSystemFirmwareTables (IN DWORD FirmwareTableProviderSignature, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize)
 
GetSystemFirmwareTable

@implemented

Obtains the firmware table data. https://msdn.microsoft.com/en-us/library/windows/desktop/ms724379(v=vs.85).aspx

Parameters
FirmwareTableProviderSignatureCan be either ACPI, FIRM, or RSMB.
FirmwareTableIDCorrect table identifier.
pFirmwareTableBufferPointer to the output buffer, can be NULL.
BufferSizeSize of the output buffer.
Returns
Actual size of the data in case of success, 0 otherwise.
Remarks
Data would be written to buffer only if the specified size is larger or equal to the actual size, in the other case Last Error value would be set to ERROR_INSUFFICIENT_BUFFER. In case of incorrect provider signature, Last Error value would be set to ERROR_INVALID_FUNCTION. Also Last Error value becomes ERROR_NOT_FOUND if incorrect table identifier was specified along with ACPI provider, and ERROR_INVALID_PARAMETER along with FIRM provider. The RSMB provider accepts any table identifier.
UINT WINAPI GetSystemFirmwareTable (IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize)
 
BOOL WINAPI GetSystemFileCacheSize (OUT PSIZE_T lpMinimumFileCacheSize, OUT PSIZE_T lpMaximumFileCacheSize, OUT PDWORD lpFlags)
 
BOOL WINAPI SetSystemFileCacheSize (IN SIZE_T MinimumFileCacheSize, IN SIZE_T MaximumFileCacheSize, IN DWORD Flags)
 
LONG WINAPI GetCurrentPackageId (UINT32 *BufferLength, BYTE *Buffer)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 18 of file sysinfo.c.

◆ PV_NT351

#define PV_NT351   0x00030033

Definition at line 21 of file sysinfo.c.

Function Documentation

◆ BaseQuerySystemFirmware()

static UINT BaseQuerySystemFirmware ( IN DWORD  FirmwareTableProviderSignature,
IN DWORD  FirmwareTableID,
OUT PVOID  pFirmwareTableBuffer,
IN DWORD  BufferSize,
IN SYSTEM_FIRMWARE_TABLE_ACTION  Action 
)
static

Definition at line 81 of file sysinfo.c.

86 {
87  SYSTEM_FIRMWARE_TABLE_INFORMATION* SysFirmwareInfo;
88  ULONG Result = 0, ReturnedSize;
91 
92  SysFirmwareInfo = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, TotalSize);
93  if (!SysFirmwareInfo)
94  {
96  return 0;
97  }
98  _SEH2_TRY
99  {
100  SysFirmwareInfo->ProviderSignature = FirmwareTableProviderSignature;
101  SysFirmwareInfo->TableID = FirmwareTableID;
102  SysFirmwareInfo->Action = Action;
103  SysFirmwareInfo->TableBufferLength = BufferSize;
104 
105  Status = NtQuerySystemInformation(SystemFirmwareTableInformation, SysFirmwareInfo, TotalSize, &ReturnedSize);
106 
108  Result = SysFirmwareInfo->TableBufferLength;
109 
110  if (NT_SUCCESS(Status) && pFirmwareTableBuffer)
111  {
112  RtlCopyMemory(pFirmwareTableBuffer, SysFirmwareInfo->TableBuffer, SysFirmwareInfo->TableBufferLength);
113  }
114  }
116  {
117  RtlFreeHeap(RtlGetProcessHeap(), 0, SysFirmwareInfo);
118  }
119  _SEH2_END;
120 
122  return Result;
123 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
_SEH2_TRY
Definition: create.c:4250
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION SYSTEM_FIRMWARE_TABLE_INFORMATION
_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:426
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
#define BufferSize
Definition: classpnp.h:419
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
_SEH2_END
Definition: create.c:4424
SYSTEM_FIRMWARE_TABLE_ACTION Action
_SEH2_FINALLY
Definition: create.c:4395
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929

Referenced by EnumSystemFirmwareTables(), and GetSystemFirmwareTable().

◆ EnumSystemFirmwareTables()

UINT WINAPI EnumSystemFirmwareTables ( IN DWORD  FirmwareTableProviderSignature,
OUT PVOID  pFirmwareTableBuffer,
IN DWORD  BufferSize 
)

Definition at line 501 of file sysinfo.c.

504 {
505  return BaseQuerySystemFirmware(FirmwareTableProviderSignature,
506  0,
507  pFirmwareTableBuffer,
508  BufferSize,
510 }
static UINT BaseQuerySystemFirmware(IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize, IN SYSTEM_FIRMWARE_TABLE_ACTION Action)
Definition: sysinfo.c:81
#define BufferSize
Definition: classpnp.h:419

◆ GetCurrentPackageId()

LONG WINAPI GetCurrentPackageId ( UINT32 BufferLength,
BYTE Buffer 
)

Definition at line 591 of file sysinfo.c.

593 {
594  STUB;
596 }
#define STUB
Definition: kernel32.h:27
#define APPMODEL_ERROR_NO_PACKAGE
Definition: winerror.h:2337

◆ GetFirmwareEnvironmentVariableA()

DWORD WINAPI GetFirmwareEnvironmentVariableA ( IN LPCSTR  lpName,
IN LPCSTR  lpGuid,
IN PVOID  pValue,
IN DWORD  nSize 
)

Definition at line 449 of file sysinfo.c.

453 {
454  STUB;
455  return 0;
456 }
#define STUB
Definition: kernel32.h:27

◆ GetFirmwareEnvironmentVariableW()

DWORD WINAPI GetFirmwareEnvironmentVariableW ( IN LPCWSTR  lpName,
IN LPCWSTR  lpGuid,
IN PVOID  pValue,
IN DWORD  nSize 
)

Definition at line 421 of file sysinfo.c.

425 {
426  STUB;
427  return 0;
428 }
#define STUB
Definition: kernel32.h:27

◆ GetLargePageMinimum()

SIZE_T WINAPI GetLargePageMinimum ( VOID  )

Definition at line 132 of file sysinfo.c.

133 {
134  return SharedUserData->LargePageMinimum;
135 }
#define SharedUserData

◆ GetLogicalProcessorInformation()

BOOL WINAPI GetLogicalProcessorInformation ( OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION  Buffer,
IN OUT PDWORD  ReturnLength 
)

Definition at line 232 of file sysinfo.c.

234 {
236 
237  if (!ReturnLength)
238  {
240  return FALSE;
241  }
242 
244  Buffer,
245  *ReturnLength,
246  ReturnLength);
247 
248  /* Normalize the error to what Win32 expects */
250  if (!NT_SUCCESS(Status))
251  {
253  return FALSE;
254  }
255 
256  return TRUE;
257 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define TRUE
Definition: types.h:120
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
Definition: bufpool.h:45
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
Status
Definition: gdiplustypes.h:24
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929

◆ GetNativeSystemInfo()

VOID WINAPI GetNativeSystemInfo ( IN LPSYSTEM_INFO  lpSystemInfo)

Definition at line 206 of file sysinfo.c.

207 {
208  SYSTEM_BASIC_INFORMATION BasicInfo;
211 
212  Status = RtlGetNativeSystemInformation(SystemBasicInformation,
213  &BasicInfo,
214  sizeof(BasicInfo),
215  0);
216  if (!NT_SUCCESS(Status)) return;
217 
218  Status = RtlGetNativeSystemInformation(SystemProcessorInformation,
219  &ProcInfo,
220  sizeof(ProcInfo),
221  0);
222  if (!NT_SUCCESS(Status)) return;
223 
224  GetSystemInfoInternal(&BasicInfo, &ProcInfo, lpSystemInfo);
225 }
LONG NTSTATUS
Definition: precomp.h:26
VOID WINAPI GetSystemInfoInternal(IN PSYSTEM_BASIC_INFORMATION BasicInfo, IN PSYSTEM_PROCESSOR_INFORMATION ProcInfo, OUT LPSYSTEM_INFO SystemInfo)
Definition: sysinfo.c:27
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24

Referenced by enumerate_gac(), get_osarchitecture(), GetSystemCPU(), init_functionpointers(), and set_installer_properties().

◆ GetNumaAvailableMemoryNode()

BOOL WINAPI GetNumaAvailableMemoryNode ( IN UCHAR  Node,
OUT PULONGLONG  AvailableBytes 
)

Definition at line 386 of file sysinfo.c.

388 {
390  SYSTEM_NUMA_INFORMATION NumaInformation;
391  ULONG Length;
392 
393  /* Query NUMA information */
395  &NumaInformation,
396  sizeof(NumaInformation),
397  &Length);
398  if (!NT_SUCCESS(Status))
399  {
401  return FALSE;
402  }
403 
404  /* Validate input node number */
405  if (Node > NumaInformation.HighestNodeNumber)
406  {
408  return FALSE;
409  }
410 
411  /* Return available memory for that node */
412  *AvailableBytes = NumaInformation.AvailableMemory[Node];
413  return TRUE;
414 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
ULONGLONG AvailableMemory[MAXIMUM_NUMA_NODES]
Definition: extypes.h:1397
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
union node Node
Definition: types.h:1255
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929
Definition: dlist.c:348

◆ GetNumaHighestNodeNumber()

BOOL WINAPI GetNumaHighestNodeNumber ( OUT PULONG  HighestNodeNumber)

Definition at line 264 of file sysinfo.c.

265 {
267  ULONG Length;
268  ULONG PartialInfo[2]; // First two members of SYSTEM_NUMA_INFORMATION
269 
270  /* Query partial NUMA info */
272  PartialInfo,
273  sizeof(PartialInfo),
274  &Length);
275  if (!NT_SUCCESS(Status))
276  {
278  return FALSE;
279  }
280 
281  if (Length < sizeof(ULONG))
282  {
284  return FALSE;
285  }
286 
287  /* First member of the struct is the highest node number */
288  *HighestNodeNumber = PartialInfo[0];
289  return TRUE;
290 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929

◆ GetNumaNodeProcessorMask()

BOOL WINAPI GetNumaNodeProcessorMask ( IN UCHAR  Node,
OUT PULONGLONG  ProcessorMask 
)

Definition at line 297 of file sysinfo.c.

299 {
301  SYSTEM_NUMA_INFORMATION NumaInformation;
302  ULONG Length;
303 
304  /* Query NUMA information */
306  &NumaInformation,
307  sizeof(NumaInformation),
308  &Length);
309  if (!NT_SUCCESS(Status))
310  {
312  return FALSE;
313  }
314 
315  /* Validate input node number */
316  if (Node > NumaInformation.HighestNodeNumber)
317  {
319  return FALSE;
320  }
321 
322  /* Return mask for that node */
323  *ProcessorMask = NumaInformation.ActiveProcessorsAffinityMask[Node];
324  return TRUE;
325 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
union node Node
Definition: types.h:1255
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:417
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
ULONGLONG ActiveProcessorsAffinityMask[MAXIMUM_NUMA_NODES]
Definition: extypes.h:1396
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929
Definition: dlist.c:348

◆ GetNumaProcessorNode()

BOOL WINAPI GetNumaProcessorNode ( IN UCHAR  Processor,
OUT PUCHAR  NodeNumber 
)

Definition at line 332 of file sysinfo.c.

334 {
336  SYSTEM_NUMA_INFORMATION NumaInformation;
337  ULONG Length;
338  ULONG Node;
339  ULONGLONG Proc;
340 
341  /* Can't handle processor number >= 32 */
343  {
344  *NodeNumber = -1;
346  return FALSE;
347  }
348 
349  /* Query NUMA information */
351  &NumaInformation,
352  sizeof(NumaInformation),
353  &Length);
354  if (!NT_SUCCESS(Status))
355  {
356  *NodeNumber = -1;
358  return FALSE;
359  }
360 
361  /* Find ourselves */
362  Node = 0;
363  Proc = 1ULL << Processor;
364  while ((Proc & NumaInformation.ActiveProcessorsAffinityMask[Node]) == 0ULL)
365  {
366  ++Node;
367  /* Out of options */
368  if (Node > NumaInformation.HighestNodeNumber)
369  {
370  *NodeNumber = -1;
372  return FALSE;
373  }
374  }
375 
376  /* Return found node */
377  *NodeNumber = Node;
378  return TRUE;
379 }
#define MAXIMUM_PROCESSORS
Definition: rwlock.h:5
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
_In_ UCHAR Processor
Definition: kefuncs.h:695
_Out_ PUSHORT NodeNumber
Definition: iofuncs.h:2567
union node Node
Definition: types.h:1255
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define ULL(a, b)
Definition: format_msg.c:27
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
uint64_t ULONGLONG
Definition: typedefs.h:65
#define SetLastError(x)
Definition: compat.h:417
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
ULONGLONG ActiveProcessorsAffinityMask[MAXIMUM_NUMA_NODES]
Definition: extypes.h:1396
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929
Definition: dlist.c:348

◆ GetSystemFileCacheSize()

BOOL WINAPI GetSystemFileCacheSize ( OUT PSIZE_T  lpMinimumFileCacheSize,
OUT PSIZE_T  lpMaximumFileCacheSize,
OUT PDWORD  lpFlags 
)

Definition at line 565 of file sysinfo.c.

568 {
569  STUB;
570  return FALSE;
571 }
#define STUB
Definition: kernel32.h:27

◆ GetSystemFirmwareTable()

UINT WINAPI GetSystemFirmwareTable ( IN DWORD  FirmwareTableProviderSignature,
IN DWORD  FirmwareTableID,
OUT PVOID  pFirmwareTableBuffer,
IN DWORD  BufferSize 
)

Definition at line 548 of file sysinfo.c.

552 {
553  return BaseQuerySystemFirmware(FirmwareTableProviderSignature,
554  FirmwareTableID,
555  pFirmwareTableBuffer,
556  BufferSize,
558 }
static UINT BaseQuerySystemFirmware(IN DWORD FirmwareTableProviderSignature, IN DWORD FirmwareTableID, OUT PVOID pFirmwareTableBuffer, IN DWORD BufferSize, IN SYSTEM_FIRMWARE_TABLE_ACTION Action)
Definition: sysinfo.c:81
#define BufferSize
Definition: classpnp.h:419

Referenced by fill_baseboard(), fill_bios(), fill_compsysproduct(), and fill_systemenclosure().

◆ GetSystemInfo()

VOID WINAPI GetSystemInfo ( IN LPSYSTEM_INFO  lpSystemInfo)

Definition at line 142 of file sysinfo.c.

143 {
144  SYSTEM_BASIC_INFORMATION BasicInfo;
147 
149  &BasicInfo,
150  sizeof(BasicInfo),
151  0);
152  if (!NT_SUCCESS(Status)) return;
153 
155  &ProcInfo,
156  sizeof(ProcInfo),
157  0);
158  if (!NT_SUCCESS(Status)) return;
159 
160  GetSystemInfoInternal(&BasicInfo, &ProcInfo, lpSystemInfo);
161 }
LONG NTSTATUS
Definition: precomp.h:26
VOID WINAPI GetSystemInfoInternal(IN PSYSTEM_BASIC_INFORMATION BasicInfo, IN PSYSTEM_PROCESSOR_INFORMATION ProcInfo, OUT LPSYSTEM_INFO SystemInfo)
Definition: sysinfo.c:27
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929

Referenced by _LocalGetPrinterLevel0(), AllSysInfo(), dump_system_info(), EmptyWorkingSet(), ExpandInstallerPath(), GetSystemCPU(), init_functionpointers(), InitializeSystemPage(), NewCtxInit(), CListNode::operator new(), PrintSystemInfo(), ProcessorDlgProc(), ProcessPageShowContextMenu(), CKsAllocator::SetProperties(), SetupDiGetActualSectionToInstallExW(), START_TEST(), StartInstaller(), StatisticsMain(), StdMemAllocator_Alloc(), TaskManager_OnTabWndSelChange(), test_affinity(), test_CompareStringW(), test_CreateFileMapping_protection(), test_CreateThread_stack(), test_dpa(), test_GetNumaProcessorNode(), test_HeapCreate(), test_mapping(), test_NtGetCurrentProcessorNumber(), test_NtQuerySection(), test_query_logicalproc(), test_query_processor_power_info(), test_SystemInfo(), test_thread_processor(), test_VirtualAlloc_protection(), test_VirtualProtect(), test_WICCreateBitmapFromSectionEx(), test_WriteFileGather(), VirtualTest(), wave_in_test_device(), wave_out_test_device(), and WICCreateBitmapFromSectionEx().

◆ GetSystemInfoInternal()

VOID WINAPI GetSystemInfoInternal ( IN PSYSTEM_BASIC_INFORMATION  BasicInfo,
IN PSYSTEM_PROCESSOR_INFORMATION  ProcInfo,
OUT LPSYSTEM_INFO  SystemInfo 
)

Definition at line 27 of file sysinfo.c.

30 {
31  RtlZeroMemory(SystemInfo, sizeof (SYSTEM_INFO));
32  SystemInfo->wProcessorArchitecture = ProcInfo->ProcessorArchitecture;
33  SystemInfo->wReserved = 0;
34  SystemInfo->dwPageSize = BasicInfo->PageSize;
35  SystemInfo->lpMinimumApplicationAddress = (PVOID)BasicInfo->MinimumUserModeAddress;
36  SystemInfo->lpMaximumApplicationAddress = (PVOID)BasicInfo->MaximumUserModeAddress;
37  SystemInfo->dwActiveProcessorMask = BasicInfo->ActiveProcessorsAffinityMask;
38  SystemInfo->dwNumberOfProcessors = BasicInfo->NumberOfProcessors;
39  SystemInfo->wProcessorLevel = ProcInfo->ProcessorLevel;
40  SystemInfo->wProcessorRevision = ProcInfo->ProcessorRevision;
41  SystemInfo->dwAllocationGranularity = BasicInfo->AllocationGranularity;
42 
43  switch (ProcInfo->ProcessorArchitecture)
44  {
46  switch (ProcInfo->ProcessorLevel)
47  {
48  case 3:
49  SystemInfo->dwProcessorType = PROCESSOR_INTEL_386;
50  break;
51  case 4:
52  SystemInfo->dwProcessorType = PROCESSOR_INTEL_486;
53  break;
54  default:
55  SystemInfo->dwProcessorType = PROCESSOR_INTEL_PENTIUM;
56  }
57  break;
58 
60  SystemInfo->dwProcessorType = PROCESSOR_AMD_X8664;
61  break;
62 
64  SystemInfo->dwProcessorType = PROCESSOR_INTEL_IA64;
65  break;
66 
67  default:
68  SystemInfo->dwProcessorType = 0;
69  break;
70  }
71 
72  if (PV_NT351 > GetProcessVersion(0))
73  {
74  SystemInfo->wProcessorLevel = 0;
75  SystemInfo->wProcessorRevision = 0;
76  }
77 }
#define PROCESSOR_ARCHITECTURE_IA64
Definition: ketypes.h:111
void * PVOID
Definition: retypes.h:9
#define PV_NT351
Definition: sysinfo.c:21
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
DWORD WINAPI GetProcessVersion(IN DWORD ProcessId)
Definition: proc.c:1760
#define PROCESSOR_INTEL_386
Definition: winnt_old.h:422
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define PROCESSOR_INTEL_IA64
Definition: winnt_old.h:427
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define PROCESSOR_AMD_X8664
Definition: winnt_old.h:433
#define PROCESSOR_INTEL_486
Definition: winnt_old.h:423
#define PROCESSOR_INTEL_PENTIUM
Definition: winnt_old.h:424

Referenced by GetNativeSystemInfo(), and GetSystemInfo().

◆ GetSystemRegistryQuota()

BOOL WINAPI GetSystemRegistryQuota ( OUT PDWORD  pdwQuotaAllowed,
OUT PDWORD  pdwQuotaUsed 
)

Definition at line 179 of file sysinfo.c.

181 {
185 
187  &QuotaInfo,
188  sizeof(QuotaInfo),
189  &BytesWritten);
190  if (NT_SUCCESS(Status))
191  {
192  if (pdwQuotaAllowed) *pdwQuotaAllowed = QuotaInfo.RegistryQuotaAllowed;
193  if (pdwQuotaUsed) *pdwQuotaUsed = QuotaInfo.RegistryQuotaUsed;
194  return TRUE;
195  }
196 
198  return FALSE;
199 }
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
__kernel_entry NTSTATUS NTAPI NtQuerySystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation, _In_ ULONG Length, _Out_opt_ PULONG UnsafeResultLength)
Definition: sysinfo.c:2929

◆ IsProcessorFeaturePresent()

BOOL WINAPI IsProcessorFeaturePresent ( IN DWORD  ProcessorFeature)

Definition at line 168 of file sysinfo.c.

169 {
170  if (ProcessorFeature >= PROCESSOR_FEATURE_MAX) return FALSE;
171  return ((BOOL)SharedUserData->ProcessorFeatures[ProcessorFeature]);
172 }
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PROCESSOR_FEATURE_MAX
#define SharedUserData

Referenced by _fpreset(), dump_system_info(), and ProcessorDlgProc().

◆ SetFirmwareEnvironmentVariableA()

BOOL WINAPI SetFirmwareEnvironmentVariableA ( IN LPCSTR  lpName,
IN LPCSTR  lpGuid,
IN PVOID  pValue,
IN DWORD  nSize 
)

Definition at line 463 of file sysinfo.c.

467 {
468  STUB;
469  return 0;
470 }
#define STUB
Definition: kernel32.h:27

◆ SetFirmwareEnvironmentVariableW()

BOOL WINAPI SetFirmwareEnvironmentVariableW ( IN LPCWSTR  lpName,
IN LPCWSTR  lpGuid,
IN PVOID  pValue,
IN DWORD  nSize 
)

Definition at line 435 of file sysinfo.c.

439 {
440  STUB;
441  return 0;
442 }
#define STUB
Definition: kernel32.h:27

◆ SetSystemFileCacheSize()

BOOL WINAPI SetSystemFileCacheSize ( IN SIZE_T  MinimumFileCacheSize,
IN SIZE_T  MaximumFileCacheSize,
IN DWORD  Flags 
)

Definition at line 578 of file sysinfo.c.

581 {
582  STUB;
583  return FALSE;
584 }
#define STUB
Definition: kernel32.h:27