ホーム › Storage.Nvme › NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER
NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| EventType | BYTE | 1 | +0 | +0 | このイベントの種別を示すコード。 |
| EventTypeRevision | BYTE | 1 | +1 | +1 | イベントタイプのリビジョン番号。 |
| EventHeaderLength | BYTE | 1 | +2 | +2 | このイベントヘッダのバイト長。 |
| Reserved0 | BYTE | 1 | +3 | +3 | 予約領域。将来拡張用で0とする。 |
| ControllerIdentifier | WORD | 2 | +4 | +4 | イベントを生成したコントローラの識別子。 |
| EventTimestamp | ULONGLONG | 8 | +6 | +6 | イベント発生時刻のタイムスタンプ。 |
| Reserved1 | BYTE | 6 | +14 | +14 | 予約領域。将来拡張用で0とする。 |
| VendorSpecificInformationLength | WORD | 2 | +20 | +20 | ベンダー固有情報のバイト長。 |
| EventLength | WORD | 2 | +22 | +22 | イベントデータ部分のバイト長。 |
各言語での定義
#include <windows.h>
// NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER (x64 24 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER {
BYTE EventType;
BYTE EventTypeRevision;
BYTE EventHeaderLength;
BYTE Reserved0;
WORD ControllerIdentifier;
ULONGLONG EventTimestamp;
BYTE Reserved1[6];
WORD VendorSpecificInformationLength;
WORD EventLength;
} NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER
{
public byte EventType;
public byte EventTypeRevision;
public byte EventHeaderLength;
public byte Reserved0;
public ushort ControllerIdentifier;
public ulong EventTimestamp;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] Reserved1;
public ushort VendorSpecificInformationLength;
public ushort EventLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER
Public EventType As Byte
Public EventTypeRevision As Byte
Public EventHeaderLength As Byte
Public Reserved0 As Byte
Public ControllerIdentifier As UShort
Public EventTimestamp As ULong
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public Reserved1() As Byte
Public VendorSpecificInformationLength As UShort
Public EventLength As UShort
End Structureimport ctypes
from ctypes import wintypes
class NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER(ctypes.Structure):
_pack_ = 1
_fields_ = [
("EventType", ctypes.c_ubyte),
("EventTypeRevision", ctypes.c_ubyte),
("EventHeaderLength", ctypes.c_ubyte),
("Reserved0", ctypes.c_ubyte),
("ControllerIdentifier", ctypes.c_ushort),
("EventTimestamp", ctypes.c_ulonglong),
("Reserved1", ctypes.c_ubyte * 6),
("VendorSpecificInformationLength", ctypes.c_ushort),
("EventLength", ctypes.c_ushort),
]#[repr(C, packed(1))]
pub struct NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER {
pub EventType: u8,
pub EventTypeRevision: u8,
pub EventHeaderLength: u8,
pub Reserved0: u8,
pub ControllerIdentifier: u16,
pub EventTimestamp: u64,
pub Reserved1: [u8; 6],
pub VendorSpecificInformationLength: u16,
pub EventLength: u16,
}import "golang.org/x/sys/windows"
type NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER struct {
EventType byte
EventTypeRevision byte
EventHeaderLength byte
Reserved0 byte
ControllerIdentifier uint16
EventTimestamp uint64
Reserved1 [6]byte
VendorSpecificInformationLength uint16
EventLength uint16
}type
NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER = packed record
EventType: Byte;
EventTypeRevision: Byte;
EventHeaderLength: Byte;
Reserved0: Byte;
ControllerIdentifier: Word;
EventTimestamp: UInt64;
Reserved1: array[0..5] of Byte;
VendorSpecificInformationLength: Word;
EventLength: Word;
end;const NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER = extern struct {
EventType: u8,
EventTypeRevision: u8,
EventHeaderLength: u8,
Reserved0: u8,
ControllerIdentifier: u16,
EventTimestamp: u64,
Reserved1: [6]u8,
VendorSpecificInformationLength: u16,
EventLength: u16,
};type
NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER {.packed.} = object
EventType: uint8
EventTypeRevision: uint8
EventHeaderLength: uint8
Reserved0: uint8
ControllerIdentifier: uint16
EventTimestamp: uint64
Reserved1: array[6, uint8]
VendorSpecificInformationLength: uint16
EventLength: uint16align(1)
struct NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER
{
ubyte EventType;
ubyte EventTypeRevision;
ubyte EventHeaderLength;
ubyte Reserved0;
ushort ControllerIdentifier;
ulong EventTimestamp;
ubyte[6] Reserved1;
ushort VendorSpecificInformationLength;
ushort EventLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; EventType : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; EventTypeRevision : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; EventHeaderLength : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; Reserved0 : BYTE (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; ControllerIdentifier : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; EventTimestamp : ULONGLONG (+6, 8byte) qpoke st,6,値 / qpeek(st,6) ※IronHSPのみ。3.7/3.8は lpoke st,6,下位 : lpoke st,10,上位
; Reserved1 : BYTE (+14, 6byte) varptr(st)+14 を基点に操作(6byte:入れ子/配列)
; VendorSpecificInformationLength : WORD (+20, 2byte) wpoke st,20,値 / 値 = wpeek(st,20)
; EventLength : WORD (+22, 2byte) wpoke st,22,値 / 値 = wpeek(st,22)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER, pack=1
#field byte EventType
#field byte EventTypeRevision
#field byte EventHeaderLength
#field byte Reserved0
#field short ControllerIdentifier
#field int64 EventTimestamp
#field byte Reserved1 6
#field short VendorSpecificInformationLength
#field short EventLength
#endstruct
stdim st, NVME_PERSISTENT_EVENT_LOG_EVENT_HEADER ; NSTRUCT 変数を確保
st->EventType = 100
mes "EventType=" + st->EventType