ホーム › System.Search › ERRORINFO
ERRORINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| hrError | HRESULT | 4 | +0 | +0 | エラーを示すHRESULT値。 |
| dwMinor | DWORD | 4 | +4 | +4 | プロバイダ固有のマイナーエラーコード(DWORD)。 |
| clsid | GUID | 16 | +8 | +8 | エラーを生成したオブジェクトのクラスID(CLSID)。 |
| iid | GUID | 16 | +24 | +24 | エラー発生時のインターフェイスID(IID)。 |
| dispid | INT | 4 | +40 | +40 | エラーが発生したメンバのディスパッチID(DISPID)。 |
各言語での定義
#include <windows.h>
// ERRORINFO (x64 44 / x86 44 バイト)
#pragma pack(push, 2)
typedef struct ERRORINFO {
HRESULT hrError;
DWORD dwMinor;
GUID clsid;
GUID iid;
INT dispid;
} ERRORINFO;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct ERRORINFO
{
public int hrError;
public uint dwMinor;
public Guid clsid;
public Guid iid;
public int dispid;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure ERRORINFO
Public hrError As Integer
Public dwMinor As UInteger
Public clsid As Guid
Public iid As Guid
Public dispid As Integer
End Structureimport ctypes
from ctypes import wintypes
class ERRORINFO(ctypes.Structure):
_pack_ = 2
_fields_ = [
("hrError", ctypes.c_int),
("dwMinor", wintypes.DWORD),
("clsid", GUID),
("iid", GUID),
("dispid", ctypes.c_int),
]#[repr(C, packed(2))]
pub struct ERRORINFO {
pub hrError: i32,
pub dwMinor: u32,
pub clsid: GUID,
pub iid: GUID,
pub dispid: i32,
}import "golang.org/x/sys/windows"
type ERRORINFO struct {
hrError int32
dwMinor uint32
clsid windows.GUID
iid windows.GUID
dispid int32
}type
ERRORINFO = packed record
hrError: Integer;
dwMinor: DWORD;
clsid: TGUID;
iid: TGUID;
dispid: Integer;
end;const ERRORINFO = extern struct {
hrError: i32,
dwMinor: u32,
clsid: GUID,
iid: GUID,
dispid: i32,
};type
ERRORINFO {.packed.} = object
hrError: int32
dwMinor: uint32
clsid: GUID
iid: GUID
dispid: int32align(2)
struct ERRORINFO
{
int hrError;
uint dwMinor;
GUID clsid;
GUID iid;
int dispid;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ERRORINFO サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; hrError : HRESULT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMinor : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; clsid : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; iid : GUID (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; dispid : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global ERRORINFO, pack=2
#field int hrError
#field int dwMinor
#field GUID clsid
#field GUID iid
#field int dispid
#endstruct
stdim st, ERRORINFO ; NSTRUCT 変数を確保
st->hrError = 100
mes "hrError=" + st->hrError