Retrieves information about the current system.
VOID GetSystemInfo(
[out] LPSYSTEM_INFO lpSystemInfo
);
| Name | Type | Description |
|---|---|---|
lpSystemInfo |
LPSYSTEM_INFO |
A pointer to a SYSTEM_INFO structure that receives the system information. |
This function does not return a value.
| Value | Description |
|---|---|
| None | This function does not return a value. |
GetSystemInfo is the same for all processors in a multiprocessor system.GetNativeSystemInfo.The SYSTEM_INFO structure contains information about the current computer system. This information can be used to optimize the performance of applications.
typedef struct _SYSTEM_INFO {
union {
DWORD dwOemId;
struct {
WORD wProcessorArchitecture;
WORD wReserved;
};
};
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
DWORD dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;
} SYSTEM_INFO, *LPSYSTEM_INFO;
wProcessorArchitecture: The processor architecture of the system. This member can be one of the following values:
PROCESSOR_ARCHITECTURE_INTEL (0x0000)PROCESSOR_ARCHITECTURE_AMD64 (0x0002)PROCESSOR_ARCHITECTURE_ARM (0x0005)PROCESSOR_ARCHITECTURE_ARM64 (0x000C)PROCESSOR_ARCHITECTURE_IA64 (0x0006)dwPageSize: The allocation granularity, in bytes, of the virtual memory.lpMinimumApplicationAddress: A pointer to the lowest memory address that is accessible to the application.lpMaximumApplicationAddress: A pointer to the highest memory address that is accessible to the application.dwActiveProcessorMask: A bitmask representing the set of active logical processors in the current group.dwNumberOfProcessors: The number of logical processors in the current group.dwProcessorType: An obsolete member that is retained for compatibility. Use wProcessorArchitecture, wProcessorLevel, and wProcessorRevision for more specific information.dwAllocationGranularity: The granularity of memory allocation for the system.wProcessorLevel: The processor level.wProcessorRevision: The processor revision.
#include <windows.h>
#include <iostream>
int main() {
SYSTEM_INFO sysInfo;
GetSystemInfo(&sysInfo);
std::cout << "Processor Architecture: " << sysInfo.wProcessorArchitecture & std::endl;
std::cout << "Number of Processors: " << sysInfo.dwNumberOfProcessors & std::endl;
std::cout << "Page Size: " << sysInfo.dwPageSize & std::endl;
std::cout << "Processor Level: " << sysInfo.wProcessorLevel & std::endl;
std::cout << "Processor Revision: " << sysInfo.wProcessorRevision & std::endl;
return 0;
}
| Client | Server |
|---|---|
| Windows 2000 Professional [desktop apps | only] | Windows 2000 Server [desktop apps | only] |
| Windows XP Professional [desktop apps | only] | Windows Server 2003 [desktop apps | only] |
| Windows Vista [desktop apps | only] | Windows Server 2008 [desktop apps | only] |
| Windows 7 [desktop apps | only] | Windows Server 2008 R2 [desktop apps | only] |
| Windows 8 [desktop apps | only] | Windows Server 2012 [desktop apps | only] |
| Windows 8.1 [desktop apps | only] | Windows Server 2012 R2 [desktop apps | only] |
| Windows 10 [desktop apps | only] | Windows Server 2016 [desktop apps | only] |
| Windows 11 [desktop apps | only] | Windows Server 2019 [desktop apps | only] |
| Windows Server 2022 [desktop apps | only] |