ホーム › System.Diagnostics.Debug › IPMI_OS_SEL_RECORD
IPMI_OS_SEL_RECORD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Signature | DWORD | 4 | +0 | +0 | IPMI OS SEL レコードの署名を示す。 |
| Version | DWORD | 4 | +4 | +4 | レコードのバージョンを示す。 |
| Length | DWORD | 4 | +8 | +8 | レコード全体のバイト長を示す。 |
| RecordType | IPMI_OS_SEL_RECORD_TYPE | 4 | +12 | +12 | SEL レコードの種別(IPMI_OS_SEL_RECORD_TYPE)を示す。 |
| DataLength | DWORD | 4 | +16 | +16 | Data 領域の有効バイト数を示す。 |
| Data | BYTE | 1 | +20 | +20 | SEL イベントの生データの先頭バイト。可変長で続く。 |
各言語での定義
#include <windows.h>
// IPMI_OS_SEL_RECORD (x64 21 / x86 21 バイト)
#pragma pack(push, 1)
typedef struct IPMI_OS_SEL_RECORD {
DWORD Signature;
DWORD Version;
DWORD Length;
IPMI_OS_SEL_RECORD_TYPE RecordType;
DWORD DataLength;
BYTE Data[1];
} IPMI_OS_SEL_RECORD;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct IPMI_OS_SEL_RECORD
{
public uint Signature;
public uint Version;
public uint Length;
public int RecordType;
public uint DataLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure IPMI_OS_SEL_RECORD
Public Signature As UInteger
Public Version As UInteger
Public Length As UInteger
Public RecordType As Integer
Public DataLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Data() As Byte
End Structureimport ctypes
from ctypes import wintypes
class IPMI_OS_SEL_RECORD(ctypes.Structure):
_pack_ = 1
_fields_ = [
("Signature", wintypes.DWORD),
("Version", wintypes.DWORD),
("Length", wintypes.DWORD),
("RecordType", ctypes.c_int),
("DataLength", wintypes.DWORD),
("Data", ctypes.c_ubyte * 1),
]#[repr(C, packed(1))]
pub struct IPMI_OS_SEL_RECORD {
pub Signature: u32,
pub Version: u32,
pub Length: u32,
pub RecordType: i32,
pub DataLength: u32,
pub Data: [u8; 1],
}import "golang.org/x/sys/windows"
type IPMI_OS_SEL_RECORD struct {
Signature uint32
Version uint32
Length uint32
RecordType int32
DataLength uint32
Data [1]byte
}type
IPMI_OS_SEL_RECORD = packed record
Signature: DWORD;
Version: DWORD;
Length: DWORD;
RecordType: Integer;
DataLength: DWORD;
Data: array[0..0] of Byte;
end;const IPMI_OS_SEL_RECORD = extern struct {
Signature: u32,
Version: u32,
Length: u32,
RecordType: i32,
DataLength: u32,
Data: [1]u8,
};type
IPMI_OS_SEL_RECORD {.packed.} = object
Signature: uint32
Version: uint32
Length: uint32
RecordType: int32
DataLength: uint32
Data: array[1, uint8]align(1)
struct IPMI_OS_SEL_RECORD
{
uint Signature;
uint Version;
uint Length;
int RecordType;
uint DataLength;
ubyte[1] Data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IPMI_OS_SEL_RECORD サイズ: 21 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 21 / 4 切り上げ)
; Signature : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Length : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; RecordType : IPMI_OS_SEL_RECORD_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; DataLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Data : BYTE (+20, 1byte) varptr(st)+20 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IPMI_OS_SEL_RECORD, pack=1
#field int Signature
#field int Version
#field int Length
#field int RecordType
#field int DataLength
#field byte Data 1
#endstruct
stdim st, IPMI_OS_SEL_RECORD ; NSTRUCT 変数を確保
st->Signature = 100
mes "Signature=" + st->Signature