Win32 API 日本語リファレンス
ホームSecurity.ExtensibleAuthenticationProtocol › EAP_METHOD_TYPE

EAP_METHOD_TYPE

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

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

フィールド

フィールドサイズx64x86説明
eapTypeEAP_TYPE12+0+0EAP方式を識別するEAP_TYPE構造体。
dwAuthorIdDWORD4+12+12EAP方式の作成者(実装者)を識別するID。

各言語での定義

#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;
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;
}
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
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),
    ]
#[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,
}
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
  EAP_TYPE = record
    type: Byte;
    dwVendorId: DWORD;
    dwVendorType: DWORD;
  end;

  EAP_METHOD_TYPE = record
    eapType: EAP_TYPE;
    dwAuthorId: DWORD;
  end;
const EAP_TYPE = extern struct {
    type: u8,
    dwVendorId: u32,
    dwVendorType: u32,
};

const EAP_METHOD_TYPE = extern struct {
    eapType: EAP_TYPE,
    dwAuthorId: u32,
};
type
  EAP_TYPE {.bycopy.} = object
    type: uint8
    dwVendorId: uint32
    dwVendorType: uint32

  EAP_METHOD_TYPE {.bycopy.} = object
    eapType: EAP_TYPE
    dwAuthorId: uint32
struct EAP_TYPE
{
    ubyte type;
    uint dwVendorId;
    uint dwVendorType;
}

struct EAP_METHOD_TYPE
{
    EAP_TYPE eapType;
    uint dwAuthorId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EAP_METHOD_TYPE サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; eapType : EAP_TYPE (+0, 12byte)  varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; dwAuthorId : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※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

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