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

EAP_PEER_METHOD_ROUTINES

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

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

フィールド

フィールドサイズx64x86説明
dwVersionDWORD4+0+0構造体のバージョン番号。
pEapTypeEAP_TYPE*8/4+8+4このルーチン群が対応するEAP方式の種別へのポインタ。
EapPeerInitializeINT_PTR8/4+16+8EapPeerInitialize関数へのポインタ。
EapPeerGetIdentityINT_PTR8/4+24+12EapPeerGetIdentity関数へのポインタ。
EapPeerBeginSessionINT_PTR8/4+32+16EapPeerBeginSession関数へのポインタ。
EapPeerSetCredentialsINT_PTR8/4+40+20EapPeerSetCredentials関数へのポインタ。
EapPeerProcessRequestPacketINT_PTR8/4+48+24EapPeerProcessRequestPacket関数へのポインタ。
EapPeerGetResponsePacketINT_PTR8/4+56+28EapPeerGetResponsePacket関数へのポインタ。
EapPeerGetResultINT_PTR8/4+64+32EapPeerGetResult関数へのポインタ。
EapPeerGetUIContextINT_PTR8/4+72+36EapPeerGetUIContext関数へのポインタ。
EapPeerSetUIContextINT_PTR8/4+80+40EapPeerSetUIContext関数へのポインタ。
EapPeerGetResponseAttributesINT_PTR8/4+88+44EapPeerGetResponseAttributes関数へのポインタ。
EapPeerSetResponseAttributesINT_PTR8/4+96+48EapPeerSetResponseAttributes関数へのポインタ。
EapPeerEndSessionINT_PTR8/4+104+52EapPeerEndSession関数へのポインタ。
EapPeerShutdownINT_PTR8/4+112+56EapPeerShutdown関数へのポインタ。

各言語での定義

#include <windows.h>

// EAP_PEER_METHOD_ROUTINES  (x64 120 / x86 60 バイト)
typedef struct EAP_PEER_METHOD_ROUTINES {
    DWORD dwVersion;
    EAP_TYPE* pEapType;
    INT_PTR EapPeerInitialize;
    INT_PTR EapPeerGetIdentity;
    INT_PTR EapPeerBeginSession;
    INT_PTR EapPeerSetCredentials;
    INT_PTR EapPeerProcessRequestPacket;
    INT_PTR EapPeerGetResponsePacket;
    INT_PTR EapPeerGetResult;
    INT_PTR EapPeerGetUIContext;
    INT_PTR EapPeerSetUIContext;
    INT_PTR EapPeerGetResponseAttributes;
    INT_PTR EapPeerSetResponseAttributes;
    INT_PTR EapPeerEndSession;
    INT_PTR EapPeerShutdown;
} EAP_PEER_METHOD_ROUTINES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_PEER_METHOD_ROUTINES
{
    public uint dwVersion;
    public IntPtr pEapType;
    public IntPtr EapPeerInitialize;
    public IntPtr EapPeerGetIdentity;
    public IntPtr EapPeerBeginSession;
    public IntPtr EapPeerSetCredentials;
    public IntPtr EapPeerProcessRequestPacket;
    public IntPtr EapPeerGetResponsePacket;
    public IntPtr EapPeerGetResult;
    public IntPtr EapPeerGetUIContext;
    public IntPtr EapPeerSetUIContext;
    public IntPtr EapPeerGetResponseAttributes;
    public IntPtr EapPeerSetResponseAttributes;
    public IntPtr EapPeerEndSession;
    public IntPtr EapPeerShutdown;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_PEER_METHOD_ROUTINES
    Public dwVersion As UInteger
    Public pEapType As IntPtr
    Public EapPeerInitialize As IntPtr
    Public EapPeerGetIdentity As IntPtr
    Public EapPeerBeginSession As IntPtr
    Public EapPeerSetCredentials As IntPtr
    Public EapPeerProcessRequestPacket As IntPtr
    Public EapPeerGetResponsePacket As IntPtr
    Public EapPeerGetResult As IntPtr
    Public EapPeerGetUIContext As IntPtr
    Public EapPeerSetUIContext As IntPtr
    Public EapPeerGetResponseAttributes As IntPtr
    Public EapPeerSetResponseAttributes As IntPtr
    Public EapPeerEndSession As IntPtr
    Public EapPeerShutdown As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class EAP_PEER_METHOD_ROUTINES(ctypes.Structure):
    _fields_ = [
        ("dwVersion", wintypes.DWORD),
        ("pEapType", ctypes.c_void_p),
        ("EapPeerInitialize", ctypes.c_ssize_t),
        ("EapPeerGetIdentity", ctypes.c_ssize_t),
        ("EapPeerBeginSession", ctypes.c_ssize_t),
        ("EapPeerSetCredentials", ctypes.c_ssize_t),
        ("EapPeerProcessRequestPacket", ctypes.c_ssize_t),
        ("EapPeerGetResponsePacket", ctypes.c_ssize_t),
        ("EapPeerGetResult", ctypes.c_ssize_t),
        ("EapPeerGetUIContext", ctypes.c_ssize_t),
        ("EapPeerSetUIContext", ctypes.c_ssize_t),
        ("EapPeerGetResponseAttributes", ctypes.c_ssize_t),
        ("EapPeerSetResponseAttributes", ctypes.c_ssize_t),
        ("EapPeerEndSession", ctypes.c_ssize_t),
        ("EapPeerShutdown", ctypes.c_ssize_t),
    ]
#[repr(C)]
pub struct EAP_PEER_METHOD_ROUTINES {
    pub dwVersion: u32,
    pub pEapType: *mut core::ffi::c_void,
    pub EapPeerInitialize: isize,
    pub EapPeerGetIdentity: isize,
    pub EapPeerBeginSession: isize,
    pub EapPeerSetCredentials: isize,
    pub EapPeerProcessRequestPacket: isize,
    pub EapPeerGetResponsePacket: isize,
    pub EapPeerGetResult: isize,
    pub EapPeerGetUIContext: isize,
    pub EapPeerSetUIContext: isize,
    pub EapPeerGetResponseAttributes: isize,
    pub EapPeerSetResponseAttributes: isize,
    pub EapPeerEndSession: isize,
    pub EapPeerShutdown: isize,
}
import "golang.org/x/sys/windows"

type EAP_PEER_METHOD_ROUTINES struct {
	dwVersion uint32
	pEapType uintptr
	EapPeerInitialize uintptr
	EapPeerGetIdentity uintptr
	EapPeerBeginSession uintptr
	EapPeerSetCredentials uintptr
	EapPeerProcessRequestPacket uintptr
	EapPeerGetResponsePacket uintptr
	EapPeerGetResult uintptr
	EapPeerGetUIContext uintptr
	EapPeerSetUIContext uintptr
	EapPeerGetResponseAttributes uintptr
	EapPeerSetResponseAttributes uintptr
	EapPeerEndSession uintptr
	EapPeerShutdown uintptr
}
type
  EAP_PEER_METHOD_ROUTINES = record
    dwVersion: DWORD;
    pEapType: Pointer;
    EapPeerInitialize: NativeInt;
    EapPeerGetIdentity: NativeInt;
    EapPeerBeginSession: NativeInt;
    EapPeerSetCredentials: NativeInt;
    EapPeerProcessRequestPacket: NativeInt;
    EapPeerGetResponsePacket: NativeInt;
    EapPeerGetResult: NativeInt;
    EapPeerGetUIContext: NativeInt;
    EapPeerSetUIContext: NativeInt;
    EapPeerGetResponseAttributes: NativeInt;
    EapPeerSetResponseAttributes: NativeInt;
    EapPeerEndSession: NativeInt;
    EapPeerShutdown: NativeInt;
  end;
const EAP_PEER_METHOD_ROUTINES = extern struct {
    dwVersion: u32,
    pEapType: ?*anyopaque,
    EapPeerInitialize: isize,
    EapPeerGetIdentity: isize,
    EapPeerBeginSession: isize,
    EapPeerSetCredentials: isize,
    EapPeerProcessRequestPacket: isize,
    EapPeerGetResponsePacket: isize,
    EapPeerGetResult: isize,
    EapPeerGetUIContext: isize,
    EapPeerSetUIContext: isize,
    EapPeerGetResponseAttributes: isize,
    EapPeerSetResponseAttributes: isize,
    EapPeerEndSession: isize,
    EapPeerShutdown: isize,
};
type
  EAP_PEER_METHOD_ROUTINES {.bycopy.} = object
    dwVersion: uint32
    pEapType: pointer
    EapPeerInitialize: int
    EapPeerGetIdentity: int
    EapPeerBeginSession: int
    EapPeerSetCredentials: int
    EapPeerProcessRequestPacket: int
    EapPeerGetResponsePacket: int
    EapPeerGetResult: int
    EapPeerGetUIContext: int
    EapPeerSetUIContext: int
    EapPeerGetResponseAttributes: int
    EapPeerSetResponseAttributes: int
    EapPeerEndSession: int
    EapPeerShutdown: int
struct EAP_PEER_METHOD_ROUTINES
{
    uint dwVersion;
    void* pEapType;
    ptrdiff_t EapPeerInitialize;
    ptrdiff_t EapPeerGetIdentity;
    ptrdiff_t EapPeerBeginSession;
    ptrdiff_t EapPeerSetCredentials;
    ptrdiff_t EapPeerProcessRequestPacket;
    ptrdiff_t EapPeerGetResponsePacket;
    ptrdiff_t EapPeerGetResult;
    ptrdiff_t EapPeerGetUIContext;
    ptrdiff_t EapPeerSetUIContext;
    ptrdiff_t EapPeerGetResponseAttributes;
    ptrdiff_t EapPeerSetResponseAttributes;
    ptrdiff_t EapPeerEndSession;
    ptrdiff_t EapPeerShutdown;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EAP_PEER_METHOD_ROUTINES サイズ: 60 バイト(x86)
dim st, 15    ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pEapType : EAP_TYPE* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; EapPeerInitialize : INT_PTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; EapPeerGetIdentity : INT_PTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; EapPeerBeginSession : INT_PTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; EapPeerSetCredentials : INT_PTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; EapPeerProcessRequestPacket : INT_PTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; EapPeerGetResponsePacket : INT_PTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; EapPeerGetResult : INT_PTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; EapPeerGetUIContext : INT_PTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; EapPeerSetUIContext : INT_PTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; EapPeerGetResponseAttributes : INT_PTR (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; EapPeerSetResponseAttributes : INT_PTR (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; EapPeerEndSession : INT_PTR (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; EapPeerShutdown : INT_PTR (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EAP_PEER_METHOD_ROUTINES サイズ: 120 バイト(x64)
dim st, 30    ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pEapType : EAP_TYPE* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; EapPeerInitialize : INT_PTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; EapPeerGetIdentity : INT_PTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; EapPeerBeginSession : INT_PTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; EapPeerSetCredentials : INT_PTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; EapPeerProcessRequestPacket : INT_PTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; EapPeerGetResponsePacket : INT_PTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; EapPeerGetResult : INT_PTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; EapPeerGetUIContext : INT_PTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; EapPeerSetUIContext : INT_PTR (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; EapPeerGetResponseAttributes : INT_PTR (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; EapPeerSetResponseAttributes : INT_PTR (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; EapPeerEndSession : INT_PTR (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; EapPeerShutdown : INT_PTR (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EAP_PEER_METHOD_ROUTINES
    #field int dwVersion
    #field intptr pEapType
    #field intptr EapPeerInitialize
    #field intptr EapPeerGetIdentity
    #field intptr EapPeerBeginSession
    #field intptr EapPeerSetCredentials
    #field intptr EapPeerProcessRequestPacket
    #field intptr EapPeerGetResponsePacket
    #field intptr EapPeerGetResult
    #field intptr EapPeerGetUIContext
    #field intptr EapPeerSetUIContext
    #field intptr EapPeerGetResponseAttributes
    #field intptr EapPeerSetResponseAttributes
    #field intptr EapPeerEndSession
    #field intptr EapPeerShutdown
#endstruct

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