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

EAP_METHOD_AUTHENTICATOR_RESULT

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

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

フィールド

フィールドサイズx64x86説明
fIsSuccessBOOL4+0+0認証が成功したかを示す真偽値。
dwFailureReasonDWORD4+4+4失敗時の理由コード。
pAuthAttribsEAP_ATTRIBUTES*8/4+8+8認証で得られたEAP属性配列へのポインタ。

各言語での定義

#include <windows.h>

// EAP_METHOD_AUTHENTICATOR_RESULT  (x64 16 / x86 12 バイト)
typedef struct EAP_METHOD_AUTHENTICATOR_RESULT {
    BOOL fIsSuccess;
    DWORD dwFailureReason;
    EAP_ATTRIBUTES* pAuthAttribs;
} EAP_METHOD_AUTHENTICATOR_RESULT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EAP_METHOD_AUTHENTICATOR_RESULT
{
    [MarshalAs(UnmanagedType.Bool)] public bool fIsSuccess;
    public uint dwFailureReason;
    public IntPtr pAuthAttribs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EAP_METHOD_AUTHENTICATOR_RESULT
    <MarshalAs(UnmanagedType.Bool)> Public fIsSuccess As Boolean
    Public dwFailureReason As UInteger
    Public pAuthAttribs As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class EAP_METHOD_AUTHENTICATOR_RESULT(ctypes.Structure):
    _fields_ = [
        ("fIsSuccess", wintypes.BOOL),
        ("dwFailureReason", wintypes.DWORD),
        ("pAuthAttribs", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct EAP_METHOD_AUTHENTICATOR_RESULT {
    pub fIsSuccess: i32,
    pub dwFailureReason: u32,
    pub pAuthAttribs: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type EAP_METHOD_AUTHENTICATOR_RESULT struct {
	fIsSuccess int32
	dwFailureReason uint32
	pAuthAttribs uintptr
}
type
  EAP_METHOD_AUTHENTICATOR_RESULT = record
    fIsSuccess: BOOL;
    dwFailureReason: DWORD;
    pAuthAttribs: Pointer;
  end;
const EAP_METHOD_AUTHENTICATOR_RESULT = extern struct {
    fIsSuccess: i32,
    dwFailureReason: u32,
    pAuthAttribs: ?*anyopaque,
};
type
  EAP_METHOD_AUTHENTICATOR_RESULT {.bycopy.} = object
    fIsSuccess: int32
    dwFailureReason: uint32
    pAuthAttribs: pointer
struct EAP_METHOD_AUTHENTICATOR_RESULT
{
    int fIsSuccess;
    uint dwFailureReason;
    void* pAuthAttribs;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EAP_METHOD_AUTHENTICATOR_RESULT サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; fIsSuccess : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFailureReason : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pAuthAttribs : EAP_ATTRIBUTES* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EAP_METHOD_AUTHENTICATOR_RESULT サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; fIsSuccess : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFailureReason : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pAuthAttribs : EAP_ATTRIBUTES* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EAP_METHOD_AUTHENTICATOR_RESULT
    #field bool fIsSuccess
    #field int dwFailureReason
    #field intptr pAuthAttribs
#endstruct

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