ホーム › System.Diagnostics.Debug.Extensions › DEBUG_ANALYSIS_PROCESSOR_INFO
DEBUG_ANALYSIS_PROCESSOR_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SizeOfStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| Model | DWORD | 4 | +4 | +4 | プロセッサのモデル番号。 |
| Family | DWORD | 4 | +8 | +8 | プロセッサのファミリ番号。 |
| Stepping | DWORD | 4 | +12 | +12 | プロセッサのステッピング(リビジョン)番号。 |
| Architecture | DWORD | 4 | +16 | +16 | プロセッサアーキテクチャを示す値。 |
| Revision | DWORD | 4 | +20 | +20 | プロセッサのリビジョン番号。 |
| CurrentClockSpeed | DWORD | 4 | +24 | +24 | 現在のクロック周波数(MHz単位)。 |
| CurrentVoltage | DWORD | 4 | +28 | +28 | 現在の動作電圧。 |
| MaxClockSpeed | DWORD | 4 | +32 | +32 | 最大クロック周波数(MHz単位)。 |
| ProcessorType | DWORD | 4 | +36 | +36 | プロセッサの種類を示す値。 |
| DeviceID | CHAR | 32 | +40 | +40 | デバイスID文字列。 |
| Manufacturer | CHAR | 64 | +72 | +72 | 製造元名の文字列。 |
| Name | CHAR | 64 | +136 | +136 | プロセッサ名の文字列。 |
| Version | CHAR | 64 | +200 | +200 | バージョン文字列。 |
| Description | CHAR | 64 | +264 | +264 | 説明文字列。 |
各言語での定義
#include <windows.h>
// DEBUG_ANALYSIS_PROCESSOR_INFO (x64 328 / x86 328 バイト)
typedef struct DEBUG_ANALYSIS_PROCESSOR_INFO {
DWORD SizeOfStruct;
DWORD Model;
DWORD Family;
DWORD Stepping;
DWORD Architecture;
DWORD Revision;
DWORD CurrentClockSpeed;
DWORD CurrentVoltage;
DWORD MaxClockSpeed;
DWORD ProcessorType;
CHAR DeviceID[32];
CHAR Manufacturer[64];
CHAR Name[64];
CHAR Version[64];
CHAR Description[64];
} DEBUG_ANALYSIS_PROCESSOR_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_ANALYSIS_PROCESSOR_INFO
{
public uint SizeOfStruct;
public uint Model;
public uint Family;
public uint Stepping;
public uint Architecture;
public uint Revision;
public uint CurrentClockSpeed;
public uint CurrentVoltage;
public uint MaxClockSpeed;
public uint ProcessorType;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public sbyte[] DeviceID;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] Manufacturer;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] Name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] Version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] Description;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_ANALYSIS_PROCESSOR_INFO
Public SizeOfStruct As UInteger
Public Model As UInteger
Public Family As UInteger
Public Stepping As UInteger
Public Architecture As UInteger
Public Revision As UInteger
Public CurrentClockSpeed As UInteger
Public CurrentVoltage As UInteger
Public MaxClockSpeed As UInteger
Public ProcessorType As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public DeviceID() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public Manufacturer() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public Name() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public Version() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public Description() As SByte
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_ANALYSIS_PROCESSOR_INFO(ctypes.Structure):
_fields_ = [
("SizeOfStruct", wintypes.DWORD),
("Model", wintypes.DWORD),
("Family", wintypes.DWORD),
("Stepping", wintypes.DWORD),
("Architecture", wintypes.DWORD),
("Revision", wintypes.DWORD),
("CurrentClockSpeed", wintypes.DWORD),
("CurrentVoltage", wintypes.DWORD),
("MaxClockSpeed", wintypes.DWORD),
("ProcessorType", wintypes.DWORD),
("DeviceID", ctypes.c_byte * 32),
("Manufacturer", ctypes.c_byte * 64),
("Name", ctypes.c_byte * 64),
("Version", ctypes.c_byte * 64),
("Description", ctypes.c_byte * 64),
]#[repr(C)]
pub struct DEBUG_ANALYSIS_PROCESSOR_INFO {
pub SizeOfStruct: u32,
pub Model: u32,
pub Family: u32,
pub Stepping: u32,
pub Architecture: u32,
pub Revision: u32,
pub CurrentClockSpeed: u32,
pub CurrentVoltage: u32,
pub MaxClockSpeed: u32,
pub ProcessorType: u32,
pub DeviceID: [i8; 32],
pub Manufacturer: [i8; 64],
pub Name: [i8; 64],
pub Version: [i8; 64],
pub Description: [i8; 64],
}import "golang.org/x/sys/windows"
type DEBUG_ANALYSIS_PROCESSOR_INFO struct {
SizeOfStruct uint32
Model uint32
Family uint32
Stepping uint32
Architecture uint32
Revision uint32
CurrentClockSpeed uint32
CurrentVoltage uint32
MaxClockSpeed uint32
ProcessorType uint32
DeviceID [32]int8
Manufacturer [64]int8
Name [64]int8
Version [64]int8
Description [64]int8
}type
DEBUG_ANALYSIS_PROCESSOR_INFO = record
SizeOfStruct: DWORD;
Model: DWORD;
Family: DWORD;
Stepping: DWORD;
Architecture: DWORD;
Revision: DWORD;
CurrentClockSpeed: DWORD;
CurrentVoltage: DWORD;
MaxClockSpeed: DWORD;
ProcessorType: DWORD;
DeviceID: array[0..31] of Shortint;
Manufacturer: array[0..63] of Shortint;
Name: array[0..63] of Shortint;
Version: array[0..63] of Shortint;
Description: array[0..63] of Shortint;
end;const DEBUG_ANALYSIS_PROCESSOR_INFO = extern struct {
SizeOfStruct: u32,
Model: u32,
Family: u32,
Stepping: u32,
Architecture: u32,
Revision: u32,
CurrentClockSpeed: u32,
CurrentVoltage: u32,
MaxClockSpeed: u32,
ProcessorType: u32,
DeviceID: [32]i8,
Manufacturer: [64]i8,
Name: [64]i8,
Version: [64]i8,
Description: [64]i8,
};type
DEBUG_ANALYSIS_PROCESSOR_INFO {.bycopy.} = object
SizeOfStruct: uint32
Model: uint32
Family: uint32
Stepping: uint32
Architecture: uint32
Revision: uint32
CurrentClockSpeed: uint32
CurrentVoltage: uint32
MaxClockSpeed: uint32
ProcessorType: uint32
DeviceID: array[32, int8]
Manufacturer: array[64, int8]
Name: array[64, int8]
Version: array[64, int8]
Description: array[64, int8]struct DEBUG_ANALYSIS_PROCESSOR_INFO
{
uint SizeOfStruct;
uint Model;
uint Family;
uint Stepping;
uint Architecture;
uint Revision;
uint CurrentClockSpeed;
uint CurrentVoltage;
uint MaxClockSpeed;
uint ProcessorType;
byte[32] DeviceID;
byte[64] Manufacturer;
byte[64] Name;
byte[64] Version;
byte[64] Description;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_ANALYSIS_PROCESSOR_INFO サイズ: 328 バイト(x64)
dim st, 82 ; 4byte整数×82(構造体サイズ 328 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Model : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Family : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Stepping : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Architecture : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Revision : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; CurrentClockSpeed : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; CurrentVoltage : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; MaxClockSpeed : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ProcessorType : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; DeviceID : CHAR (+40, 32byte) varptr(st)+40 を基点に操作(32byte:入れ子/配列)
; Manufacturer : CHAR (+72, 64byte) varptr(st)+72 を基点に操作(64byte:入れ子/配列)
; Name : CHAR (+136, 64byte) varptr(st)+136 を基点に操作(64byte:入れ子/配列)
; Version : CHAR (+200, 64byte) varptr(st)+200 を基点に操作(64byte:入れ子/配列)
; Description : CHAR (+264, 64byte) varptr(st)+264 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_ANALYSIS_PROCESSOR_INFO
#field int SizeOfStruct
#field int Model
#field int Family
#field int Stepping
#field int Architecture
#field int Revision
#field int CurrentClockSpeed
#field int CurrentVoltage
#field int MaxClockSpeed
#field int ProcessorType
#field byte DeviceID 32
#field byte Manufacturer 64
#field byte Name 64
#field byte Version 64
#field byte Description 64
#endstruct
stdim st, DEBUG_ANALYSIS_PROCESSOR_INFO ; NSTRUCT 変数を確保
st->SizeOfStruct = 100
mes "SizeOfStruct=" + st->SizeOfStruct