Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug.Extensions › CPU_INFO_v2

CPU_INFO_v2

構造体
サイズx64: 40976 バイト / x86: 40976 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
TypeDWORD4+0+0プロセッサのアーキテクチャ種別を示す値。
NumCPUsDWORD4+4+4論理プロセッサ数。
CurrentProcDWORD4+8+8現在対象としているプロセッサのインデックス。
ProcInfoDEBUG_PROCESSOR_IDENTIFICATION_ALL40960+12+12プロセッサ識別情報を格納するDEBUG_PROCESSOR_IDENTIFICATION_ALL共用体。
MhzDWORD4+40972+40972プロセッサのクロック周波数(MHz単位)。

各言語での定義

#include <windows.h>

// DEBUG_PROCESSOR_IDENTIFICATION_ALPHA  (x64 8 / x86 8 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_ALPHA {
    DWORD Type;
    DWORD Revision;
} DEBUG_PROCESSOR_IDENTIFICATION_ALPHA;

// DEBUG_PROCESSOR_IDENTIFICATION_AMD64  (x64 28 / x86 28 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_AMD64 {
    DWORD Family;
    DWORD Model;
    DWORD Stepping;
    CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_AMD64;

// DEBUG_PROCESSOR_IDENTIFICATION_IA64  (x64 32 / x86 32 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_IA64 {
    DWORD Model;
    DWORD Revision;
    DWORD Family;
    DWORD ArchRev;
    CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_IA64;

// DEBUG_PROCESSOR_IDENTIFICATION_X86  (x64 28 / x86 28 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_X86 {
    DWORD Family;
    DWORD Model;
    DWORD Stepping;
    CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_X86;

// DEBUG_PROCESSOR_IDENTIFICATION_ARM  (x64 24 / x86 24 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_ARM {
    DWORD Model;
    DWORD Revision;
    CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_ARM;

// DEBUG_PROCESSOR_IDENTIFICATION_ARM64  (x64 24 / x86 24 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_ARM64 {
    DWORD Model;
    DWORD Revision;
    CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_ARM64;

// DEBUG_PROCESSOR_IDENTIFICATION_ALL  (x64 32 / x86 32 バイト)
typedef struct DEBUG_PROCESSOR_IDENTIFICATION_ALL {
    DEBUG_PROCESSOR_IDENTIFICATION_ALPHA Alpha;
    DEBUG_PROCESSOR_IDENTIFICATION_AMD64 Amd64;
    DEBUG_PROCESSOR_IDENTIFICATION_IA64 Ia64;
    DEBUG_PROCESSOR_IDENTIFICATION_X86 X86;
    DEBUG_PROCESSOR_IDENTIFICATION_ARM Arm;
    DEBUG_PROCESSOR_IDENTIFICATION_ARM64 Arm64;
} DEBUG_PROCESSOR_IDENTIFICATION_ALL;

// CPU_INFO_v2  (x64 40976 / x86 40976 バイト)
typedef struct CPU_INFO_v2 {
    DWORD Type;
    DWORD NumCPUs;
    DWORD CurrentProc;
    DEBUG_PROCESSOR_IDENTIFICATION_ALL ProcInfo[1280];
    DWORD Mhz;
} CPU_INFO_v2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
{
    public uint Type;
    public uint Revision;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_AMD64
{
    public uint Family;
    public uint Model;
    public uint Stepping;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] VendorString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_IA64
{
    public uint Model;
    public uint Revision;
    public uint Family;
    public uint ArchRev;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] VendorString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_X86
{
    public uint Family;
    public uint Model;
    public uint Stepping;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] VendorString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_ARM
{
    public uint Model;
    public uint Revision;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] VendorString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_ARM64
{
    public uint Model;
    public uint Revision;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public sbyte[] VendorString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_PROCESSOR_IDENTIFICATION_ALL
{
    public DEBUG_PROCESSOR_IDENTIFICATION_ALPHA Alpha;
    public DEBUG_PROCESSOR_IDENTIFICATION_AMD64 Amd64;
    public DEBUG_PROCESSOR_IDENTIFICATION_IA64 Ia64;
    public DEBUG_PROCESSOR_IDENTIFICATION_X86 X86;
    public DEBUG_PROCESSOR_IDENTIFICATION_ARM Arm;
    public DEBUG_PROCESSOR_IDENTIFICATION_ARM64 Arm64;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CPU_INFO_v2
{
    public uint Type;
    public uint NumCPUs;
    public uint CurrentProc;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1280)] public DEBUG_PROCESSOR_IDENTIFICATION_ALL[] ProcInfo;
    public uint Mhz;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
    Public Type As UInteger
    Public Revision As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_AMD64
    Public Family As UInteger
    Public Model As UInteger
    Public Stepping As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VendorString() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_IA64
    Public Model As UInteger
    Public Revision As UInteger
    Public Family As UInteger
    Public ArchRev As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VendorString() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_X86
    Public Family As UInteger
    Public Model As UInteger
    Public Stepping As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VendorString() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_ARM
    Public Model As UInteger
    Public Revision As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VendorString() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_ARM64
    Public Model As UInteger
    Public Revision As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VendorString() As SByte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_PROCESSOR_IDENTIFICATION_ALL
    Public Alpha As DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
    Public Amd64 As DEBUG_PROCESSOR_IDENTIFICATION_AMD64
    Public Ia64 As DEBUG_PROCESSOR_IDENTIFICATION_IA64
    Public X86 As DEBUG_PROCESSOR_IDENTIFICATION_X86
    Public Arm As DEBUG_PROCESSOR_IDENTIFICATION_ARM
    Public Arm64 As DEBUG_PROCESSOR_IDENTIFICATION_ARM64
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CPU_INFO_v2
    Public Type As UInteger
    Public NumCPUs As UInteger
    Public CurrentProc As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1280)> Public ProcInfo() As DEBUG_PROCESSOR_IDENTIFICATION_ALL
    Public Mhz As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DEBUG_PROCESSOR_IDENTIFICATION_ALPHA(ctypes.Structure):
    _fields_ = [
        ("Type", wintypes.DWORD),
        ("Revision", wintypes.DWORD),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_AMD64(ctypes.Structure):
    _fields_ = [
        ("Family", wintypes.DWORD),
        ("Model", wintypes.DWORD),
        ("Stepping", wintypes.DWORD),
        ("VendorString", ctypes.c_byte * 16),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_IA64(ctypes.Structure):
    _fields_ = [
        ("Model", wintypes.DWORD),
        ("Revision", wintypes.DWORD),
        ("Family", wintypes.DWORD),
        ("ArchRev", wintypes.DWORD),
        ("VendorString", ctypes.c_byte * 16),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_X86(ctypes.Structure):
    _fields_ = [
        ("Family", wintypes.DWORD),
        ("Model", wintypes.DWORD),
        ("Stepping", wintypes.DWORD),
        ("VendorString", ctypes.c_byte * 16),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_ARM(ctypes.Structure):
    _fields_ = [
        ("Model", wintypes.DWORD),
        ("Revision", wintypes.DWORD),
        ("VendorString", ctypes.c_byte * 16),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_ARM64(ctypes.Structure):
    _fields_ = [
        ("Model", wintypes.DWORD),
        ("Revision", wintypes.DWORD),
        ("VendorString", ctypes.c_byte * 16),
    ]

class DEBUG_PROCESSOR_IDENTIFICATION_ALL(ctypes.Structure):
    _fields_ = [
        ("Alpha", DEBUG_PROCESSOR_IDENTIFICATION_ALPHA),
        ("Amd64", DEBUG_PROCESSOR_IDENTIFICATION_AMD64),
        ("Ia64", DEBUG_PROCESSOR_IDENTIFICATION_IA64),
        ("X86", DEBUG_PROCESSOR_IDENTIFICATION_X86),
        ("Arm", DEBUG_PROCESSOR_IDENTIFICATION_ARM),
        ("Arm64", DEBUG_PROCESSOR_IDENTIFICATION_ARM64),
    ]

class CPU_INFO_v2(ctypes.Structure):
    _fields_ = [
        ("Type", wintypes.DWORD),
        ("NumCPUs", wintypes.DWORD),
        ("CurrentProc", wintypes.DWORD),
        ("ProcInfo", DEBUG_PROCESSOR_IDENTIFICATION_ALL * 1280),
        ("Mhz", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_ALPHA {
    pub Type: u32,
    pub Revision: u32,
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_AMD64 {
    pub Family: u32,
    pub Model: u32,
    pub Stepping: u32,
    pub VendorString: [i8; 16],
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_IA64 {
    pub Model: u32,
    pub Revision: u32,
    pub Family: u32,
    pub ArchRev: u32,
    pub VendorString: [i8; 16],
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_X86 {
    pub Family: u32,
    pub Model: u32,
    pub Stepping: u32,
    pub VendorString: [i8; 16],
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_ARM {
    pub Model: u32,
    pub Revision: u32,
    pub VendorString: [i8; 16],
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_ARM64 {
    pub Model: u32,
    pub Revision: u32,
    pub VendorString: [i8; 16],
}

#[repr(C)]
pub struct DEBUG_PROCESSOR_IDENTIFICATION_ALL {
    pub Alpha: DEBUG_PROCESSOR_IDENTIFICATION_ALPHA,
    pub Amd64: DEBUG_PROCESSOR_IDENTIFICATION_AMD64,
    pub Ia64: DEBUG_PROCESSOR_IDENTIFICATION_IA64,
    pub X86: DEBUG_PROCESSOR_IDENTIFICATION_X86,
    pub Arm: DEBUG_PROCESSOR_IDENTIFICATION_ARM,
    pub Arm64: DEBUG_PROCESSOR_IDENTIFICATION_ARM64,
}

#[repr(C)]
pub struct CPU_INFO_v2 {
    pub Type: u32,
    pub NumCPUs: u32,
    pub CurrentProc: u32,
    pub ProcInfo: [DEBUG_PROCESSOR_IDENTIFICATION_ALL; 1280],
    pub Mhz: u32,
}
import "golang.org/x/sys/windows"

type DEBUG_PROCESSOR_IDENTIFICATION_ALPHA struct {
	Type uint32
	Revision uint32
}

type DEBUG_PROCESSOR_IDENTIFICATION_AMD64 struct {
	Family uint32
	Model uint32
	Stepping uint32
	VendorString [16]int8
}

type DEBUG_PROCESSOR_IDENTIFICATION_IA64 struct {
	Model uint32
	Revision uint32
	Family uint32
	ArchRev uint32
	VendorString [16]int8
}

type DEBUG_PROCESSOR_IDENTIFICATION_X86 struct {
	Family uint32
	Model uint32
	Stepping uint32
	VendorString [16]int8
}

type DEBUG_PROCESSOR_IDENTIFICATION_ARM struct {
	Model uint32
	Revision uint32
	VendorString [16]int8
}

type DEBUG_PROCESSOR_IDENTIFICATION_ARM64 struct {
	Model uint32
	Revision uint32
	VendorString [16]int8
}

type DEBUG_PROCESSOR_IDENTIFICATION_ALL struct {
	Alpha DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
	Amd64 DEBUG_PROCESSOR_IDENTIFICATION_AMD64
	Ia64 DEBUG_PROCESSOR_IDENTIFICATION_IA64
	X86 DEBUG_PROCESSOR_IDENTIFICATION_X86
	Arm DEBUG_PROCESSOR_IDENTIFICATION_ARM
	Arm64 DEBUG_PROCESSOR_IDENTIFICATION_ARM64
}

type CPU_INFO_v2 struct {
	Type uint32
	NumCPUs uint32
	CurrentProc uint32
	ProcInfo [1280]DEBUG_PROCESSOR_IDENTIFICATION_ALL
	Mhz uint32
}
type
  DEBUG_PROCESSOR_IDENTIFICATION_ALPHA = record
    Type: DWORD;
    Revision: DWORD;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_AMD64 = record
    Family: DWORD;
    Model: DWORD;
    Stepping: DWORD;
    VendorString: array[0..15] of Shortint;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_IA64 = record
    Model: DWORD;
    Revision: DWORD;
    Family: DWORD;
    ArchRev: DWORD;
    VendorString: array[0..15] of Shortint;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_X86 = record
    Family: DWORD;
    Model: DWORD;
    Stepping: DWORD;
    VendorString: array[0..15] of Shortint;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_ARM = record
    Model: DWORD;
    Revision: DWORD;
    VendorString: array[0..15] of Shortint;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_ARM64 = record
    Model: DWORD;
    Revision: DWORD;
    VendorString: array[0..15] of Shortint;
  end;

  DEBUG_PROCESSOR_IDENTIFICATION_ALL = record
    Alpha: DEBUG_PROCESSOR_IDENTIFICATION_ALPHA;
    Amd64: DEBUG_PROCESSOR_IDENTIFICATION_AMD64;
    Ia64: DEBUG_PROCESSOR_IDENTIFICATION_IA64;
    X86: DEBUG_PROCESSOR_IDENTIFICATION_X86;
    Arm: DEBUG_PROCESSOR_IDENTIFICATION_ARM;
    Arm64: DEBUG_PROCESSOR_IDENTIFICATION_ARM64;
  end;

  CPU_INFO_v2 = record
    Type: DWORD;
    NumCPUs: DWORD;
    CurrentProc: DWORD;
    ProcInfo: array[0..1279] of DEBUG_PROCESSOR_IDENTIFICATION_ALL;
    Mhz: DWORD;
  end;
const DEBUG_PROCESSOR_IDENTIFICATION_ALPHA = extern struct {
    Type: u32,
    Revision: u32,
};

const DEBUG_PROCESSOR_IDENTIFICATION_AMD64 = extern struct {
    Family: u32,
    Model: u32,
    Stepping: u32,
    VendorString: [16]i8,
};

const DEBUG_PROCESSOR_IDENTIFICATION_IA64 = extern struct {
    Model: u32,
    Revision: u32,
    Family: u32,
    ArchRev: u32,
    VendorString: [16]i8,
};

const DEBUG_PROCESSOR_IDENTIFICATION_X86 = extern struct {
    Family: u32,
    Model: u32,
    Stepping: u32,
    VendorString: [16]i8,
};

const DEBUG_PROCESSOR_IDENTIFICATION_ARM = extern struct {
    Model: u32,
    Revision: u32,
    VendorString: [16]i8,
};

const DEBUG_PROCESSOR_IDENTIFICATION_ARM64 = extern struct {
    Model: u32,
    Revision: u32,
    VendorString: [16]i8,
};

const DEBUG_PROCESSOR_IDENTIFICATION_ALL = extern struct {
    Alpha: DEBUG_PROCESSOR_IDENTIFICATION_ALPHA,
    Amd64: DEBUG_PROCESSOR_IDENTIFICATION_AMD64,
    Ia64: DEBUG_PROCESSOR_IDENTIFICATION_IA64,
    X86: DEBUG_PROCESSOR_IDENTIFICATION_X86,
    Arm: DEBUG_PROCESSOR_IDENTIFICATION_ARM,
    Arm64: DEBUG_PROCESSOR_IDENTIFICATION_ARM64,
};

const CPU_INFO_v2 = extern struct {
    Type: u32,
    NumCPUs: u32,
    CurrentProc: u32,
    ProcInfo: [1280]DEBUG_PROCESSOR_IDENTIFICATION_ALL,
    Mhz: u32,
};
type
  DEBUG_PROCESSOR_IDENTIFICATION_ALPHA {.bycopy.} = object
    Type: uint32
    Revision: uint32

  DEBUG_PROCESSOR_IDENTIFICATION_AMD64 {.bycopy.} = object
    Family: uint32
    Model: uint32
    Stepping: uint32
    VendorString: array[16, int8]

  DEBUG_PROCESSOR_IDENTIFICATION_IA64 {.bycopy.} = object
    Model: uint32
    Revision: uint32
    Family: uint32
    ArchRev: uint32
    VendorString: array[16, int8]

  DEBUG_PROCESSOR_IDENTIFICATION_X86 {.bycopy.} = object
    Family: uint32
    Model: uint32
    Stepping: uint32
    VendorString: array[16, int8]

  DEBUG_PROCESSOR_IDENTIFICATION_ARM {.bycopy.} = object
    Model: uint32
    Revision: uint32
    VendorString: array[16, int8]

  DEBUG_PROCESSOR_IDENTIFICATION_ARM64 {.bycopy.} = object
    Model: uint32
    Revision: uint32
    VendorString: array[16, int8]

  DEBUG_PROCESSOR_IDENTIFICATION_ALL {.bycopy.} = object
    Alpha: DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
    Amd64: DEBUG_PROCESSOR_IDENTIFICATION_AMD64
    Ia64: DEBUG_PROCESSOR_IDENTIFICATION_IA64
    X86: DEBUG_PROCESSOR_IDENTIFICATION_X86
    Arm: DEBUG_PROCESSOR_IDENTIFICATION_ARM
    Arm64: DEBUG_PROCESSOR_IDENTIFICATION_ARM64

  CPU_INFO_v2 {.bycopy.} = object
    Type: uint32
    NumCPUs: uint32
    CurrentProc: uint32
    ProcInfo: array[1280, DEBUG_PROCESSOR_IDENTIFICATION_ALL]
    Mhz: uint32
struct DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
{
    uint Type;
    uint Revision;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_AMD64
{
    uint Family;
    uint Model;
    uint Stepping;
    byte[16] VendorString;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_IA64
{
    uint Model;
    uint Revision;
    uint Family;
    uint ArchRev;
    byte[16] VendorString;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_X86
{
    uint Family;
    uint Model;
    uint Stepping;
    byte[16] VendorString;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_ARM
{
    uint Model;
    uint Revision;
    byte[16] VendorString;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_ARM64
{
    uint Model;
    uint Revision;
    byte[16] VendorString;
}

struct DEBUG_PROCESSOR_IDENTIFICATION_ALL
{
    DEBUG_PROCESSOR_IDENTIFICATION_ALPHA Alpha;
    DEBUG_PROCESSOR_IDENTIFICATION_AMD64 Amd64;
    DEBUG_PROCESSOR_IDENTIFICATION_IA64 Ia64;
    DEBUG_PROCESSOR_IDENTIFICATION_X86 X86;
    DEBUG_PROCESSOR_IDENTIFICATION_ARM Arm;
    DEBUG_PROCESSOR_IDENTIFICATION_ARM64 Arm64;
}

struct CPU_INFO_v2
{
    uint Type;
    uint NumCPUs;
    uint CurrentProc;
    DEBUG_PROCESSOR_IDENTIFICATION_ALL[1280] ProcInfo;
    uint Mhz;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CPU_INFO_v2 サイズ: 40976 バイト(x64)
dim st, 10244    ; 4byte整数×10244(構造体サイズ 40976 / 4 切り上げ)
; Type : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; NumCPUs : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; CurrentProc : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ProcInfo : DEBUG_PROCESSOR_IDENTIFICATION_ALL (+12, 40960byte)  varptr(st)+12 を基点に操作(40960byte:入れ子/配列)
; Mhz : DWORD (+40972, 4byte)  st.10243 = 値  /  値 = st.10243   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CPU_INFO_v2
    #field int Type
    #field int NumCPUs
    #field int CurrentProc
    #field byte ProcInfo 40960
    #field int Mhz
#endstruct

stdim st, CPU_INFO_v2        ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。