GetSystemInfo 填充 TSystemInfo (對應 _SYSTEM_INFO) 結構,提供處理器架構 (x86/x64/ARM)、頁面大小、最小/最大應用程式定址空間、作用中處理器遮罩、邏輯處理器數量、處理器類型/等級/修訂、配置粒度等關鍵硬體資訊。
_SYSTEM_INFO = record
case Integer of
0: (dwOemId: DWORD); // 已棄用
1: (
wProcessorArchitecture: Word; // 0: x86, 9: x64, 5: ARM, 12: ARM64
wReserved: Word;
dwPageSize: DWORD; // 通常 4096
lpMinimumApplicationAddress: Pointer;
lpMaximumApplicationAddress: Pointer;
dwActiveProcessorMask: DWORD; // 位元遮罩
dwNumberOfProcessors: DWORD; // 邏輯核心數
dwProcessorType: DWORD;
dwAllocationGranularity: DWORD; // 通常 65536 (64KB)
wProcessorLevel: Word;
wProcessorRevision: Word
);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
SI: TSystemInfo;
begin
GetSystemInfo(SI);
Memo1.Clear;
with Memo1.Lines do
begin
Add(Format('OEM ID: %d', [SI.dwOemId]));
Add(Format('處理器架構: %d', [SI.wProcessorArchitecture]));
Add(Format('分頁大小: %d', [SI.dwPageSize]));
Add(Format('最小定址: %d', [Integer(SI.lpMinimumApplicationAddress)]));
Add(Format('最大定址: %d', [Integer(SI.lpMaximumApplicationAddress)]));
Add(Format('處理器遮罩: %d', [SI.dwActiveProcessorMask]));
Add(Format('處理器數量: %d', [SI.dwNumberOfProcessors]));
Add(Format('處理器類型: %d', [SI.dwProcessorType]));
Add(Format('配置粒度: %d', [SI.dwAllocationGranularity]));
Add(Format('處理器等級: %d', [SI.wProcessorLevel]));
Add(Format('處理器修訂: %d', [SI.wProcessorRevision]));
end;
end;

| 值 | 架構 |
|---|---|
| 0 | PROCESSOR_ARCHITECTURE_INTEL (x86) |
| 5 | PROCESSOR_ARCHITECTURE_ARM |
| 9 | PROCESSOR_ARCHITECTURE_AMD64 (x64) |
| 12 | PROCESSOR_ARCHITECTURE_ARM64 |
| 0xFFFF | PROCESSOR_ARCHITECTURE_UNKNOWN |
配合 GetLogicalProcessorInformation 可取得更詳細的 NUMA 節點、快取層級等資訊。