Win32 API 日本語リファレンス
ホームNetworkManagement.WiFi › ONEX_EAP_ERROR

ONEX_EAP_ERROR

構造体
サイズx64: 92 バイト / x86: 92 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwWinErrorDWORD4+0+0対応するWin32エラーコード。
typeEAP_METHOD_TYPE16+4+4エラーが発生したEAPメソッドの種別。
dwReasonCodeDWORD4+20+20エラーの理由コード。
rootCauseGuidGUID16+24+24根本原因を識別するGUID。
repairGuidGUID16+40+40修復方法を識別するGUID。
helpLinkGuidGUID16+56+56ヘルプリンクを識別するGUID。
_bitfieldDWORD4+72+72文字列の有無などを示すフラグのビットフィールド。
RootCauseStringONEX_VARIABLE_BLOB8+76+76根本原因の説明文字列を指す可変長ブロブ。
RepairStringONEX_VARIABLE_BLOB8+84+84修復方法の説明文字列を指す可変長ブロブ。

各言語での定義

#include <windows.h>

// EAP_TYPE  (x64 12 / x86 12 バイト)
typedef struct EAP_TYPE {
    BYTE type;
    DWORD dwVendorId;
    DWORD dwVendorType;
} EAP_TYPE;

// EAP_METHOD_TYPE  (x64 16 / x86 16 バイト)
typedef struct EAP_METHOD_TYPE {
    EAP_TYPE eapType;
    DWORD dwAuthorId;
} EAP_METHOD_TYPE;

// ONEX_VARIABLE_BLOB  (x64 8 / x86 8 バイト)
typedef struct ONEX_VARIABLE_BLOB {
    DWORD dwSize;
    DWORD dwOffset;
} ONEX_VARIABLE_BLOB;

// ONEX_EAP_ERROR  (x64 92 / x86 92 バイト)
typedef struct ONEX_EAP_ERROR {
    DWORD dwWinError;
    EAP_METHOD_TYPE type;
    DWORD dwReasonCode;
    GUID rootCauseGuid;
    GUID repairGuid;
    GUID helpLinkGuid;
    DWORD _bitfield;
    ONEX_VARIABLE_BLOB RootCauseString;
    ONEX_VARIABLE_BLOB RepairString;
} ONEX_EAP_ERROR;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_TYPE
{
    public byte type;
    public uint dwVendorId;
    public uint dwVendorType;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_METHOD_TYPE
{
    public EAP_TYPE eapType;
    public uint dwAuthorId;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ONEX_VARIABLE_BLOB
{
    public uint dwSize;
    public uint dwOffset;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ONEX_EAP_ERROR
{
    public uint dwWinError;
    public EAP_METHOD_TYPE type;
    public uint dwReasonCode;
    public Guid rootCauseGuid;
    public Guid repairGuid;
    public Guid helpLinkGuid;
    public uint _bitfield;
    public ONEX_VARIABLE_BLOB RootCauseString;
    public ONEX_VARIABLE_BLOB RepairString;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_TYPE
    Public type As Byte
    Public dwVendorId As UInteger
    Public dwVendorType As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_METHOD_TYPE
    Public eapType As EAP_TYPE
    Public dwAuthorId As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ONEX_VARIABLE_BLOB
    Public dwSize As UInteger
    Public dwOffset As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ONEX_EAP_ERROR
    Public dwWinError As UInteger
    Public type As EAP_METHOD_TYPE
    Public dwReasonCode As UInteger
    Public rootCauseGuid As Guid
    Public repairGuid As Guid
    Public helpLinkGuid As Guid
    Public _bitfield As UInteger
    Public RootCauseString As ONEX_VARIABLE_BLOB
    Public RepairString As ONEX_VARIABLE_BLOB
End Structure
import ctypes
from ctypes import wintypes

class EAP_TYPE(ctypes.Structure):
    _fields_ = [
        ("type", ctypes.c_ubyte),
        ("dwVendorId", wintypes.DWORD),
        ("dwVendorType", wintypes.DWORD),
    ]

class EAP_METHOD_TYPE(ctypes.Structure):
    _fields_ = [
        ("eapType", EAP_TYPE),
        ("dwAuthorId", wintypes.DWORD),
    ]

class ONEX_VARIABLE_BLOB(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwOffset", wintypes.DWORD),
    ]

class ONEX_EAP_ERROR(ctypes.Structure):
    _fields_ = [
        ("dwWinError", wintypes.DWORD),
        ("type", EAP_METHOD_TYPE),
        ("dwReasonCode", wintypes.DWORD),
        ("rootCauseGuid", GUID),
        ("repairGuid", GUID),
        ("helpLinkGuid", GUID),
        ("_bitfield", wintypes.DWORD),
        ("RootCauseString", ONEX_VARIABLE_BLOB),
        ("RepairString", ONEX_VARIABLE_BLOB),
    ]
#[repr(C)]
pub struct EAP_TYPE {
    pub type: u8,
    pub dwVendorId: u32,
    pub dwVendorType: u32,
}

#[repr(C)]
pub struct EAP_METHOD_TYPE {
    pub eapType: EAP_TYPE,
    pub dwAuthorId: u32,
}

#[repr(C)]
pub struct ONEX_VARIABLE_BLOB {
    pub dwSize: u32,
    pub dwOffset: u32,
}

#[repr(C)]
pub struct ONEX_EAP_ERROR {
    pub dwWinError: u32,
    pub type: EAP_METHOD_TYPE,
    pub dwReasonCode: u32,
    pub rootCauseGuid: GUID,
    pub repairGuid: GUID,
    pub helpLinkGuid: GUID,
    pub _bitfield: u32,
    pub RootCauseString: ONEX_VARIABLE_BLOB,
    pub RepairString: ONEX_VARIABLE_BLOB,
}
import "golang.org/x/sys/windows"

type EAP_TYPE struct {
	type byte
	dwVendorId uint32
	dwVendorType uint32
}

type EAP_METHOD_TYPE struct {
	eapType EAP_TYPE
	dwAuthorId uint32
}

type ONEX_VARIABLE_BLOB struct {
	dwSize uint32
	dwOffset uint32
}

type ONEX_EAP_ERROR struct {
	dwWinError uint32
	type EAP_METHOD_TYPE
	dwReasonCode uint32
	rootCauseGuid windows.GUID
	repairGuid windows.GUID
	helpLinkGuid windows.GUID
	_bitfield uint32
	RootCauseString ONEX_VARIABLE_BLOB
	RepairString ONEX_VARIABLE_BLOB
}
type
  EAP_TYPE = record
    type: Byte;
    dwVendorId: DWORD;
    dwVendorType: DWORD;
  end;

  EAP_METHOD_TYPE = record
    eapType: EAP_TYPE;
    dwAuthorId: DWORD;
  end;

  ONEX_VARIABLE_BLOB = record
    dwSize: DWORD;
    dwOffset: DWORD;
  end;

  ONEX_EAP_ERROR = record
    dwWinError: DWORD;
    type: EAP_METHOD_TYPE;
    dwReasonCode: DWORD;
    rootCauseGuid: TGUID;
    repairGuid: TGUID;
    helpLinkGuid: TGUID;
    _bitfield: DWORD;
    RootCauseString: ONEX_VARIABLE_BLOB;
    RepairString: ONEX_VARIABLE_BLOB;
  end;
const EAP_TYPE = extern struct {
    type: u8,
    dwVendorId: u32,
    dwVendorType: u32,
};

const EAP_METHOD_TYPE = extern struct {
    eapType: EAP_TYPE,
    dwAuthorId: u32,
};

const ONEX_VARIABLE_BLOB = extern struct {
    dwSize: u32,
    dwOffset: u32,
};

const ONEX_EAP_ERROR = extern struct {
    dwWinError: u32,
    type: EAP_METHOD_TYPE,
    dwReasonCode: u32,
    rootCauseGuid: GUID,
    repairGuid: GUID,
    helpLinkGuid: GUID,
    _bitfield: u32,
    RootCauseString: ONEX_VARIABLE_BLOB,
    RepairString: ONEX_VARIABLE_BLOB,
};
type
  EAP_TYPE {.bycopy.} = object
    type: uint8
    dwVendorId: uint32
    dwVendorType: uint32

  EAP_METHOD_TYPE {.bycopy.} = object
    eapType: EAP_TYPE
    dwAuthorId: uint32

  ONEX_VARIABLE_BLOB {.bycopy.} = object
    dwSize: uint32
    dwOffset: uint32

  ONEX_EAP_ERROR {.bycopy.} = object
    dwWinError: uint32
    type: EAP_METHOD_TYPE
    dwReasonCode: uint32
    rootCauseGuid: GUID
    repairGuid: GUID
    helpLinkGuid: GUID
    _bitfield: uint32
    RootCauseString: ONEX_VARIABLE_BLOB
    RepairString: ONEX_VARIABLE_BLOB
struct EAP_TYPE
{
    ubyte type;
    uint dwVendorId;
    uint dwVendorType;
}

struct EAP_METHOD_TYPE
{
    EAP_TYPE eapType;
    uint dwAuthorId;
}

struct ONEX_VARIABLE_BLOB
{
    uint dwSize;
    uint dwOffset;
}

struct ONEX_EAP_ERROR
{
    uint dwWinError;
    EAP_METHOD_TYPE type;
    uint dwReasonCode;
    GUID rootCauseGuid;
    GUID repairGuid;
    GUID helpLinkGuid;
    uint _bitfield;
    ONEX_VARIABLE_BLOB RootCauseString;
    ONEX_VARIABLE_BLOB RepairString;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ONEX_EAP_ERROR サイズ: 92 バイト(x64)
dim st, 23    ; 4byte整数×23(構造体サイズ 92 / 4 切り上げ)
; dwWinError : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; type : EAP_METHOD_TYPE (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwReasonCode : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; rootCauseGuid : GUID (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; repairGuid : GUID (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; helpLinkGuid : GUID (+56, 16byte)  varptr(st)+56 を基点に操作(16byte:入れ子/配列)
; _bitfield : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; RootCauseString : ONEX_VARIABLE_BLOB (+76, 8byte)  varptr(st)+76 を基点に操作(8byte:入れ子/配列)
; RepairString : ONEX_VARIABLE_BLOB (+84, 8byte)  varptr(st)+84 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global EAP_TYPE
    #field byte type
    #field int dwVendorId
    #field int dwVendorType
#endstruct

#defstruct global EAP_METHOD_TYPE
    #field EAP_TYPE eapType
    #field int dwAuthorId
#endstruct

#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global ONEX_VARIABLE_BLOB
    #field int dwSize
    #field int dwOffset
#endstruct

#defstruct global ONEX_EAP_ERROR
    #field int dwWinError
    #field EAP_METHOD_TYPE type
    #field int dwReasonCode
    #field GUID rootCauseGuid
    #field GUID repairGuid
    #field GUID helpLinkGuid
    #field int _bitfield
    #field ONEX_VARIABLE_BLOB RootCauseString
    #field ONEX_VARIABLE_BLOB RepairString
#endstruct

stdim st, ONEX_EAP_ERROR        ; NSTRUCT 変数を確保
st->dwWinError = 100
mes "dwWinError=" + st->dwWinError