ホーム › System.Diagnostics.Debug › WHEA_ERROR_SOURCE_DESCRIPTOR
WHEA_ERROR_SOURCE_DESCRIPTOR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Length | DWORD | 4 | +0 | +0 | この記述子のバイト長を示す。 |
| Version | DWORD | 4 | +4 | +4 | 記述子のバージョンを示す。 |
| Type | WHEA_ERROR_SOURCE_TYPE | 4 | +8 | +8 | エラーソースの種別(WHEA_ERROR_SOURCE_TYPE)を示す。 |
| State | WHEA_ERROR_SOURCE_STATE | 4 | +12 | +12 | エラーソースの状態(WHEA_ERROR_SOURCE_STATE)を示す。 |
| MaxRawDataLength | DWORD | 4 | +16 | +16 | 生データの最大バイト長を示す。 |
| NumRecordsToPreallocate | DWORD | 4 | +20 | +20 | 事前確保するエラーレコード数を示す。 |
| MaxSectionsPerRecord | DWORD | 4 | +24 | +24 | 1レコードあたりの最大セクション数を示す。 |
| ErrorSourceId | DWORD | 4 | +28 | +28 | エラーソースを識別する ID を示す。 |
| PlatformErrorSourceId | DWORD | 4 | +32 | +32 | プラットフォーム側のエラーソース ID を示す。 |
| Flags | DWORD | 4 | +36 | +36 | エラーソースの属性フラグを示す。 |
| Info | _Info_e__Union | 920 | +40 | +40 | エラーソース種別ごとの詳細情報を保持する無名共用体。 |
共用体: _Info_e__Union x64 920B / x86 920B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| XpfMceDescriptor | WHEA_XPF_MCE_DESCRIPTOR | 920 | +0 | +0 |
| XpfCmcDescriptor | WHEA_XPF_CMC_DESCRIPTOR | 920/912 | +0 | +0 |
| XpfNmiDescriptor | WHEA_XPF_NMI_DESCRIPTOR | 3 | +0 | +0 |
| IpfMcaDescriptor | WHEA_IPF_MCA_DESCRIPTOR | 4 | +0 | +0 |
| IpfCmcDescriptor | WHEA_IPF_CMC_DESCRIPTOR | 4 | +0 | +0 |
| IpfCpeDescriptor | WHEA_IPF_CPE_DESCRIPTOR | 4 | +0 | +0 |
| AerRootportDescriptor | WHEA_AER_ROOTPORT_DESCRIPTOR | 40/36 | +0 | +0 |
| AerEndpointDescriptor | WHEA_AER_ENDPOINT_DESCRIPTOR | 36/32 | +0 | +0 |
| AerBridgeDescriptor | WHEA_AER_BRIDGE_DESCRIPTOR | 48/44 | +0 | +0 |
| GenErrDescriptor | WHEA_GENERIC_ERROR_DESCRIPTOR | 40/32 | +0 | +0 |
| GenErrDescriptorV2 | WHEA_GENERIC_ERROR_DESCRIPTOR_V2 | 68/60 | +0 | +0 |
| DeviceDriverDescriptor | WHEA_DEVICE_DRIVER_DESCRIPTOR | 116/96 | +0 | +0 |
各言語での定義
#include <windows.h>
// WHEA_ERROR_SOURCE_DESCRIPTOR (x64 960 / x86 960 バイト)
#pragma pack(push, 1)
typedef struct WHEA_ERROR_SOURCE_DESCRIPTOR {
DWORD Length;
DWORD Version;
WHEA_ERROR_SOURCE_TYPE Type;
WHEA_ERROR_SOURCE_STATE State;
DWORD MaxRawDataLength;
DWORD NumRecordsToPreallocate;
DWORD MaxSectionsPerRecord;
DWORD ErrorSourceId;
DWORD PlatformErrorSourceId;
DWORD Flags;
_Info_e__Union Info;
} WHEA_ERROR_SOURCE_DESCRIPTOR;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct WHEA_ERROR_SOURCE_DESCRIPTOR
{
public uint Length;
public uint Version;
public int Type;
public int State;
public uint MaxRawDataLength;
public uint NumRecordsToPreallocate;
public uint MaxSectionsPerRecord;
public uint ErrorSourceId;
public uint PlatformErrorSourceId;
public uint Flags;
public _Info_e__Union Info;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure WHEA_ERROR_SOURCE_DESCRIPTOR
Public Length As UInteger
Public Version As UInteger
Public Type As Integer
Public State As Integer
Public MaxRawDataLength As UInteger
Public NumRecordsToPreallocate As UInteger
Public MaxSectionsPerRecord As UInteger
Public ErrorSourceId As UInteger
Public PlatformErrorSourceId As UInteger
Public Flags As UInteger
Public Info As _Info_e__Union
End Structureimport ctypes
from ctypes import wintypes
class WHEA_ERROR_SOURCE_DESCRIPTOR(ctypes.Structure):
_pack_ = 1
_fields_ = [
("Length", wintypes.DWORD),
("Version", wintypes.DWORD),
("Type", ctypes.c_int),
("State", ctypes.c_int),
("MaxRawDataLength", wintypes.DWORD),
("NumRecordsToPreallocate", wintypes.DWORD),
("MaxSectionsPerRecord", wintypes.DWORD),
("ErrorSourceId", wintypes.DWORD),
("PlatformErrorSourceId", wintypes.DWORD),
("Flags", wintypes.DWORD),
("Info", _Info_e__Union),
]#[repr(C, packed(1))]
pub struct WHEA_ERROR_SOURCE_DESCRIPTOR {
pub Length: u32,
pub Version: u32,
pub Type: i32,
pub State: i32,
pub MaxRawDataLength: u32,
pub NumRecordsToPreallocate: u32,
pub MaxSectionsPerRecord: u32,
pub ErrorSourceId: u32,
pub PlatformErrorSourceId: u32,
pub Flags: u32,
pub Info: _Info_e__Union,
}import "golang.org/x/sys/windows"
type WHEA_ERROR_SOURCE_DESCRIPTOR struct {
Length uint32
Version uint32
Type int32
State int32
MaxRawDataLength uint32
NumRecordsToPreallocate uint32
MaxSectionsPerRecord uint32
ErrorSourceId uint32
PlatformErrorSourceId uint32
Flags uint32
Info _Info_e__Union
}type
WHEA_ERROR_SOURCE_DESCRIPTOR = packed record
Length: DWORD;
Version: DWORD;
Type: Integer;
State: Integer;
MaxRawDataLength: DWORD;
NumRecordsToPreallocate: DWORD;
MaxSectionsPerRecord: DWORD;
ErrorSourceId: DWORD;
PlatformErrorSourceId: DWORD;
Flags: DWORD;
Info: _Info_e__Union;
end;const WHEA_ERROR_SOURCE_DESCRIPTOR = extern struct {
Length: u32,
Version: u32,
Type: i32,
State: i32,
MaxRawDataLength: u32,
NumRecordsToPreallocate: u32,
MaxSectionsPerRecord: u32,
ErrorSourceId: u32,
PlatformErrorSourceId: u32,
Flags: u32,
Info: _Info_e__Union,
};type
WHEA_ERROR_SOURCE_DESCRIPTOR {.packed.} = object
Length: uint32
Version: uint32
Type: int32
State: int32
MaxRawDataLength: uint32
NumRecordsToPreallocate: uint32
MaxSectionsPerRecord: uint32
ErrorSourceId: uint32
PlatformErrorSourceId: uint32
Flags: uint32
Info: _Info_e__Unionalign(1)
struct WHEA_ERROR_SOURCE_DESCRIPTOR
{
uint Length;
uint Version;
int Type;
int State;
uint MaxRawDataLength;
uint NumRecordsToPreallocate;
uint MaxSectionsPerRecord;
uint ErrorSourceId;
uint PlatformErrorSourceId;
uint Flags;
_Info_e__Union Info;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WHEA_ERROR_SOURCE_DESCRIPTOR サイズ: 960 バイト(x64)
dim st, 240 ; 4byte整数×240(構造体サイズ 960 / 4 切り上げ)
; Length : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Type : WHEA_ERROR_SOURCE_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; State : WHEA_ERROR_SOURCE_STATE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MaxRawDataLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; NumRecordsToPreallocate : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; MaxSectionsPerRecord : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ErrorSourceId : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; PlatformErrorSourceId : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Flags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Info : _Info_e__Union (+40, 920byte) varptr(st)+40 を基点に操作(920byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WHEA_ERROR_SOURCE_DESCRIPTOR, pack=1
#field int Length
#field int Version
#field int Type
#field int State
#field int MaxRawDataLength
#field int NumRecordsToPreallocate
#field int MaxSectionsPerRecord
#field int ErrorSourceId
#field int PlatformErrorSourceId
#field int Flags
#field byte Info 920
#endstruct
stdim st, WHEA_ERROR_SOURCE_DESCRIPTOR ; NSTRUCT 変数を確保
st->Length = 100
mes "Length=" + st->Length
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。