ホーム › System.Rpc › RPC_EXTENDED_ERROR_INFO
RPC_EXTENDED_ERROR_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | この構造体のバージョン。 |
| ComputerName | LPWSTR | 8/4 | +8 | +4 | エラーが発生したコンピューター名。LPWSTR型。 |
| ProcessID | DWORD | 4 | +16 | +8 | エラーを発生させたプロセスのID。 |
| u | _u_e__Union | 16 | +20 | +12 | エラー発生時刻などを保持する共用体。 |
| GeneratingComponent | DWORD | 4 | +36 | +28 | エラーを生成したコンポーネントの識別子。 |
| Status | DWORD | 4 | +40 | +32 | エラーステータスコード。 |
| DetectionLocation | WORD | 2 | +44 | +36 | エラーが検出された場所を示すコード。 |
| Flags | WORD | 2 | +46 | +38 | 拡張エラー情報の動作を示すフラグ。 |
| NumberOfParameters | INT | 4 | +48 | +40 | Parameters配列の要素数。 |
| Parameters | RPC_EE_INFO_PARAM | 96/64 | +56 | +48 | エラーに関連するパラメーターの配列。RPC_EE_INFO_PARAMの先頭要素。 |
共用体: _u_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| SystemTime | SYSTEMTIME | 16 | +0 | +0 |
| FileTime | FILETIME | 8 | +0 | +0 |
各言語での定義
#include <windows.h>
// RPC_EE_INFO_PARAM (x64 24 / x86 16 バイト)
typedef struct RPC_EE_INFO_PARAM {
ExtendedErrorParamTypes ParameterType;
_u_e__Union u;
} RPC_EE_INFO_PARAM;
// RPC_EXTENDED_ERROR_INFO (x64 152 / x86 112 バイト)
typedef struct RPC_EXTENDED_ERROR_INFO {
DWORD Version;
LPWSTR ComputerName;
DWORD ProcessID;
_u_e__Union u;
DWORD GeneratingComponent;
DWORD Status;
WORD DetectionLocation;
WORD Flags;
INT NumberOfParameters;
RPC_EE_INFO_PARAM Parameters[4];
} RPC_EXTENDED_ERROR_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_EE_INFO_PARAM
{
public int ParameterType;
public _u_e__Union u;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_EXTENDED_ERROR_INFO
{
public uint Version;
public IntPtr ComputerName;
public uint ProcessID;
public _u_e__Union u;
public uint GeneratingComponent;
public uint Status;
public ushort DetectionLocation;
public ushort Flags;
public int NumberOfParameters;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public RPC_EE_INFO_PARAM[] Parameters;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_EE_INFO_PARAM
Public ParameterType As Integer
Public u As _u_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_EXTENDED_ERROR_INFO
Public Version As UInteger
Public ComputerName As IntPtr
Public ProcessID As UInteger
Public u As _u_e__Union
Public GeneratingComponent As UInteger
Public Status As UInteger
Public DetectionLocation As UShort
Public Flags As UShort
Public NumberOfParameters As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public Parameters() As RPC_EE_INFO_PARAM
End Structureimport ctypes
from ctypes import wintypes
class RPC_EE_INFO_PARAM(ctypes.Structure):
_fields_ = [
("ParameterType", ctypes.c_int),
("u", _u_e__Union),
]
class RPC_EXTENDED_ERROR_INFO(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("ComputerName", ctypes.c_void_p),
("ProcessID", wintypes.DWORD),
("u", _u_e__Union),
("GeneratingComponent", wintypes.DWORD),
("Status", wintypes.DWORD),
("DetectionLocation", ctypes.c_ushort),
("Flags", ctypes.c_ushort),
("NumberOfParameters", ctypes.c_int),
("Parameters", RPC_EE_INFO_PARAM * 4),
]#[repr(C)]
pub struct RPC_EE_INFO_PARAM {
pub ParameterType: i32,
pub u: _u_e__Union,
}
#[repr(C)]
pub struct RPC_EXTENDED_ERROR_INFO {
pub Version: u32,
pub ComputerName: *mut core::ffi::c_void,
pub ProcessID: u32,
pub u: _u_e__Union,
pub GeneratingComponent: u32,
pub Status: u32,
pub DetectionLocation: u16,
pub Flags: u16,
pub NumberOfParameters: i32,
pub Parameters: [RPC_EE_INFO_PARAM; 4],
}import "golang.org/x/sys/windows"
type RPC_EE_INFO_PARAM struct {
ParameterType int32
u _u_e__Union
}
type RPC_EXTENDED_ERROR_INFO struct {
Version uint32
ComputerName uintptr
ProcessID uint32
u _u_e__Union
GeneratingComponent uint32
Status uint32
DetectionLocation uint16
Flags uint16
NumberOfParameters int32
Parameters [4]RPC_EE_INFO_PARAM
}type
RPC_EE_INFO_PARAM = record
ParameterType: Integer;
u: _u_e__Union;
end;
RPC_EXTENDED_ERROR_INFO = record
Version: DWORD;
ComputerName: Pointer;
ProcessID: DWORD;
u: _u_e__Union;
GeneratingComponent: DWORD;
Status: DWORD;
DetectionLocation: Word;
Flags: Word;
NumberOfParameters: Integer;
Parameters: array[0..3] of RPC_EE_INFO_PARAM;
end;const RPC_EE_INFO_PARAM = extern struct {
ParameterType: i32,
u: _u_e__Union,
};
const RPC_EXTENDED_ERROR_INFO = extern struct {
Version: u32,
ComputerName: ?*anyopaque,
ProcessID: u32,
u: _u_e__Union,
GeneratingComponent: u32,
Status: u32,
DetectionLocation: u16,
Flags: u16,
NumberOfParameters: i32,
Parameters: [4]RPC_EE_INFO_PARAM,
};type
RPC_EE_INFO_PARAM {.bycopy.} = object
ParameterType: int32
u: _u_e__Union
RPC_EXTENDED_ERROR_INFO {.bycopy.} = object
Version: uint32
ComputerName: pointer
ProcessID: uint32
u: _u_e__Union
GeneratingComponent: uint32
Status: uint32
DetectionLocation: uint16
Flags: uint16
NumberOfParameters: int32
Parameters: array[4, RPC_EE_INFO_PARAM]struct RPC_EE_INFO_PARAM
{
int ParameterType;
_u_e__Union u;
}
struct RPC_EXTENDED_ERROR_INFO
{
uint Version;
void* ComputerName;
uint ProcessID;
_u_e__Union u;
uint GeneratingComponent;
uint Status;
ushort DetectionLocation;
ushort Flags;
int NumberOfParameters;
RPC_EE_INFO_PARAM[4] Parameters;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RPC_EXTENDED_ERROR_INFO サイズ: 112 バイト(x86)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ComputerName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ProcessID : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; u : _u_e__Union (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; GeneratingComponent : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Status : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; DetectionLocation : WORD (+36, 2byte) wpoke st,36,値 / 値 = wpeek(st,36)
; Flags : WORD (+38, 2byte) wpoke st,38,値 / 値 = wpeek(st,38)
; NumberOfParameters : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; Parameters : RPC_EE_INFO_PARAM (+48, 64byte) varptr(st)+48 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RPC_EXTENDED_ERROR_INFO サイズ: 152 バイト(x64)
dim st, 38 ; 4byte整数×38(構造体サイズ 152 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ComputerName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ProcessID : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; u : _u_e__Union (+20, 16byte) varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; GeneratingComponent : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Status : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; DetectionLocation : WORD (+44, 2byte) wpoke st,44,値 / 値 = wpeek(st,44)
; Flags : WORD (+46, 2byte) wpoke st,46,値 / 値 = wpeek(st,46)
; NumberOfParameters : INT (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Parameters : RPC_EE_INFO_PARAM (+56, 96byte) varptr(st)+56 を基点に操作(96byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RPC_EE_INFO_PARAM
#field int ParameterType
#field byte u 16
#endstruct
#defstruct global RPC_EXTENDED_ERROR_INFO
#field int Version
#field intptr ComputerName
#field int ProcessID
#field byte u 16
#field int GeneratingComponent
#field int Status
#field short DetectionLocation
#field short Flags
#field int NumberOfParameters
#field RPC_EE_INFO_PARAM Parameters 4
#endstruct
stdim st, RPC_EXTENDED_ERROR_INFO ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。