GetSystemInfo

Function

GetSystemInfo retrieves information about the current system.

Syntax

VOID GetSystemInfo(
  _Out_ LPSYSTEM_INFO lpSystemInfo
);

Parameters

Parameter Description
lpSystemInfo A pointer to a SYSTEM_INFO structure that receives general information about the current computer. This structure contains information about the processor architecture, the number of processors, the page size, and the amount of physical memory and virtual memory available.

Return value

This function does not return a value.

Remarks

The GetSystemInfo function retrieves a system's architecture-dependent information into the SYSTEM_INFO structure.

To retrieve detailed system information, use the GlobalMemoryStatusEx function.

For a table of supported operating systems, see Supported operating systems.

Requirements

Attribute Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

SYSTEM_INFO Structure

The SYSTEM_INFO structure receives general information about the current computer. This structure contains information about the processor architecture, the number of processors, the page size, and the amount of physical memory and virtual memory available.

Syntax

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;

Members

Member Description
dwOemId This member is reserved. Do not use it.
wProcessorArchitecture The processor architecture of the current computer. This member can be one of the following values:
  • PROCESSOR_ARCHITECTURE_AMD64 (0x0009)
  • PROCESSOR_ARCHITECTURE_ARM (0x0005)
  • PROCESSOR_ARCHITECTURE_ARM64 (0x000C)
  • PROCESSOR_ARCHITECTURE_IA64 (0x0006)
  • PROCESSOR_ARCHITECTURE_INTEL (0x0000)
  • PROCESSOR_ARCHITECTURE_MIPS (0x0003)
  • PROCESSOR_ARCHITECTURE_MIPS64 (0x0010)
  • PROCESSOR_ARCHITECTURE_PPCBE (0x0017)
  • PROCESSOR_ARCHITECTURE_SHX (0x0004)
  • PROCESSOR_ARCHITECTURE_SH_MSA (0x0002)
  • PROCESSOR_ARCHITECTURE_UNKNOWN (0xFFFF)
dwPageSize The page size, in bytes.
lpMinimumApplicationAddress A pointer to the minimum address space available to an application.
lpMaximumApplicationAddress A pointer to the maximum address space available to an application. If the system is WOW64 (32-bit Windows on a 64-bit system), this member is (LPVOID)0x7FFFFFFF. If the system is not WOW64, the value is (LPVOID)0xFFFFFFFF.
dwActiveProcessorMask A mask representing the set of processors currently active in the system.
dwNumberOfProcessors The number of logical processors in the current processor group.
dwProcessorType An array of bits that specify the type of processor in the system. This member can be one of the following values:
  • PROCESSOR_INTEL_386 (0x00000001)
  • PROCESSOR_INTEL_486 (0x00000002)
  • PROCESSOR_INTEL_PENTIUM (0x00000003)
  • PROCESSOR_MIPS_R10000 (0x00001001)
  • PROCESSOR_MIPS_R2000 (0x00002001)
  • PROCESSOR_MIPS_R3000 (0x00003001)
  • PROCESSOR_ALPHA_21064 (0x00000101)
  • PROCESSOR_PPC_601 (0x00000102)
  • PROCESSOR_PPC_603 (0x00000103)
  • PROCESSOR_PPC_604 (0x00000104)
  • PROCESSOR_PPC_620 (0x00000105)
  • PROCESSOR_HITACHI_SH3 (0x00000201)
  • PROCESSOR_HITACHI_SH3DSP (0x00000202)
  • PROCESSOR_HITACHI_SH4 (0x00000203)
  • PROCESSOR_ALPHA_21164 (0x00000106)
  • PROCESSOR_AMD_X8664 (0x00000007)
  • PROCESSOR_FXSR (0x00000008)
  • PROCESSOR_SSE (0x00000010)
  • PROCESSOR_SSE2 (0x00000020)
  • PROCESSOR_ించాలి (0x00000040)
  • PROCESSOR_ించాలి2 (0x00000080)
  • PROCESSOR_ించాలి3 (0x00000100)
  • PROCESSOR_ించాలి4 (0x00000200)
  • PROCESSOR_ించాలి5 (0x00000400)
  • PROCESSOR_ించాలి6 (0x00000800)
  • PROCESSOR_ించాలి7 (0x00001000)
  • PROCESSOR_ించాలి8 (0x00002000)
  • PROCESSOR_ించాలి9 (0x00004000)
  • PROCESSOR_ించాలి10 (0x00008000)
  • PROCESSOR_ించాలి11 (0x00010000)
  • PROCESSOR_ించాలి12 (0x00020000)
  • PROCESSOR_ించాలి13 (0x00040000)
  • PROCESSOR_ించాలి14 (0x00080000)
  • PROCESSOR_ించాలి15 (0x00100000)
  • PROCESSOR_ించాలి16 (0x00200000)
  • PROCESSOR_ించాలి17 (0x00400000)
  • PROCESSOR_ించాలి18 (0x00800000)
  • PROCESSOR_ించాలి19 (0x01000000)
  • PROCESSOR_ించాలి20 (0x02000000)
  • PROCESSOR_ించాలి21 (0x04000000)
  • PROCESSOR_ించాలి22 (0x08000000)
  • PROCESSOR_ించాలి23 (0x10000000)
  • PROCESSOR_ించాలి24 (0x20000000)
Note that the system may support multiple processor types.
dwAllocationGranularity The granularity of the memory allocation, in bytes. This is the value for the dwGranularity member of the VirtualAlloc function.
wProcessorLevel The level of the current processor. The value is processor-specific.
wProcessorRevision The revision number of the current processor.

Example

The following C++ code retrieves system information and prints the number of processors and the page size.

#include <windows.h>
#include <iostream>

int main() {
    SYSTEM_INFO sysInfo;
    GetSystemInfo(&sysInfo);

    std::wcout << L"Number of processors: " << sysInfo.dwNumberOfProcessors << std::endl;
    std::wcout << L"Page size: " << sysInfo.dwPageSize << L" bytes" << std::endl;
    std::wcout << L"Processor type: " << sysInfo.dwProcessorType << std::endl;

    return 0;
}