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

PPP_EAP_INFO

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

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

フィールド

フィールドサイズx64x86説明
dwSizeInBytesDWORD4+0+0この構造体のバイト数。
dwEapTypeIdDWORD4+4+4EAP方式を識別する種別ID。
RasEapInitializeINT_PTR8/4+8+8RasEapInitialize関数へのポインタ。
RasEapBeginINT_PTR8/4+16+12RasEapBegin関数へのポインタ。
RasEapEndINT_PTR8/4+24+16RasEapEnd関数へのポインタ。
RasEapMakeMessageINT_PTR8/4+32+20RasEapMakeMessage関数へのポインタ。

各言語での定義

#include <windows.h>

// PPP_EAP_INFO  (x64 40 / x86 24 バイト)
typedef struct PPP_EAP_INFO {
    DWORD dwSizeInBytes;
    DWORD dwEapTypeId;
    INT_PTR RasEapInitialize;
    INT_PTR RasEapBegin;
    INT_PTR RasEapEnd;
    INT_PTR RasEapMakeMessage;
} PPP_EAP_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_EAP_INFO
{
    public uint dwSizeInBytes;
    public uint dwEapTypeId;
    public IntPtr RasEapInitialize;
    public IntPtr RasEapBegin;
    public IntPtr RasEapEnd;
    public IntPtr RasEapMakeMessage;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_EAP_INFO
    Public dwSizeInBytes As UInteger
    Public dwEapTypeId As UInteger
    Public RasEapInitialize As IntPtr
    Public RasEapBegin As IntPtr
    Public RasEapEnd As IntPtr
    Public RasEapMakeMessage As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class PPP_EAP_INFO(ctypes.Structure):
    _fields_ = [
        ("dwSizeInBytes", wintypes.DWORD),
        ("dwEapTypeId", wintypes.DWORD),
        ("RasEapInitialize", ctypes.c_ssize_t),
        ("RasEapBegin", ctypes.c_ssize_t),
        ("RasEapEnd", ctypes.c_ssize_t),
        ("RasEapMakeMessage", ctypes.c_ssize_t),
    ]
#[repr(C)]
pub struct PPP_EAP_INFO {
    pub dwSizeInBytes: u32,
    pub dwEapTypeId: u32,
    pub RasEapInitialize: isize,
    pub RasEapBegin: isize,
    pub RasEapEnd: isize,
    pub RasEapMakeMessage: isize,
}
import "golang.org/x/sys/windows"

type PPP_EAP_INFO struct {
	dwSizeInBytes uint32
	dwEapTypeId uint32
	RasEapInitialize uintptr
	RasEapBegin uintptr
	RasEapEnd uintptr
	RasEapMakeMessage uintptr
}
type
  PPP_EAP_INFO = record
    dwSizeInBytes: DWORD;
    dwEapTypeId: DWORD;
    RasEapInitialize: NativeInt;
    RasEapBegin: NativeInt;
    RasEapEnd: NativeInt;
    RasEapMakeMessage: NativeInt;
  end;
const PPP_EAP_INFO = extern struct {
    dwSizeInBytes: u32,
    dwEapTypeId: u32,
    RasEapInitialize: isize,
    RasEapBegin: isize,
    RasEapEnd: isize,
    RasEapMakeMessage: isize,
};
type
  PPP_EAP_INFO {.bycopy.} = object
    dwSizeInBytes: uint32
    dwEapTypeId: uint32
    RasEapInitialize: int
    RasEapBegin: int
    RasEapEnd: int
    RasEapMakeMessage: int
struct PPP_EAP_INFO
{
    uint dwSizeInBytes;
    uint dwEapTypeId;
    ptrdiff_t RasEapInitialize;
    ptrdiff_t RasEapBegin;
    ptrdiff_t RasEapEnd;
    ptrdiff_t RasEapMakeMessage;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PPP_EAP_INFO サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwSizeInBytes : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; RasEapInitialize : INT_PTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; RasEapBegin : INT_PTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; RasEapEnd : INT_PTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; RasEapMakeMessage : INT_PTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PPP_EAP_INFO サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwSizeInBytes : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; RasEapInitialize : INT_PTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; RasEapBegin : INT_PTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; RasEapEnd : INT_PTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; RasEapMakeMessage : INT_PTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PPP_EAP_INFO
    #field int dwSizeInBytes
    #field int dwEapTypeId
    #field intptr RasEapInitialize
    #field intptr RasEapBegin
    #field intptr RasEapEnd
    #field intptr RasEapMakeMessage
#endstruct

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