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

RASPPPLCPW

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のバイト単位のサイズ。
fBundledBOOL4+4+4TRUEなら接続が複数リンクに束ねられていることを示す。
dwErrorDWORD4+8+8LCPネゴシエーション中のエラーコード。0なら正常。
dwAuthenticationProtocolDWORD4+12+12クライアントが使用した認証プロトコル(RASLCPAP_*)。
dwAuthenticationDataDWORD4+16+16使用された認証データの種別(RASLCPAD_*)。
dwEapTypeIdDWORD4+20+20EAP使用時のEAPタイプ識別子。
dwServerAuthenticationProtocolDWORD4+24+24サーバーが使用した認証プロトコル。
dwServerAuthenticationDataDWORD4+28+28サーバー側の認証データ種別。
dwServerEapTypeIdDWORD4+32+32サーバー側のEAPタイプ識別子。
fMultilinkBOOL4+36+36TRUEならマルチリンクPPPがネゴシエートされたことを示す。
dwTerminateReasonDWORD4+40+40クライアント側の接続終了理由コード。
dwServerTerminateReasonDWORD4+44+44サーバー側の接続終了理由コード。
szReplyMessageWCHAR2048+48+48認証時にサーバーから返されたメッセージ(ワイド文字列)。
dwOptionsDWORD4+2096+2096クライアントのLCPオプションフラグ(RASLCPO_*)。
dwServerOptionsDWORD4+2100+2100サーバーのLCPオプションフラグ。

各言語での定義

#include <windows.h>

// RASPPPLCPW  (x64 2104 / x86 2104 バイト)
typedef struct RASPPPLCPW {
    DWORD dwSize;
    BOOL fBundled;
    DWORD dwError;
    DWORD dwAuthenticationProtocol;
    DWORD dwAuthenticationData;
    DWORD dwEapTypeId;
    DWORD dwServerAuthenticationProtocol;
    DWORD dwServerAuthenticationData;
    DWORD dwServerEapTypeId;
    BOOL fMultilink;
    DWORD dwTerminateReason;
    DWORD dwServerTerminateReason;
    WCHAR szReplyMessage[1024];
    DWORD dwOptions;
    DWORD dwServerOptions;
} RASPPPLCPW;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASPPPLCPW
{
    public uint dwSize;
    [MarshalAs(UnmanagedType.Bool)] public bool fBundled;
    public uint dwError;
    public uint dwAuthenticationProtocol;
    public uint dwAuthenticationData;
    public uint dwEapTypeId;
    public uint dwServerAuthenticationProtocol;
    public uint dwServerAuthenticationData;
    public uint dwServerEapTypeId;
    [MarshalAs(UnmanagedType.Bool)] public bool fMultilink;
    public uint dwTerminateReason;
    public uint dwServerTerminateReason;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string szReplyMessage;
    public uint dwOptions;
    public uint dwServerOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASPPPLCPW
    Public dwSize As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public fBundled As Boolean
    Public dwError As UInteger
    Public dwAuthenticationProtocol As UInteger
    Public dwAuthenticationData As UInteger
    Public dwEapTypeId As UInteger
    Public dwServerAuthenticationProtocol As UInteger
    Public dwServerAuthenticationData As UInteger
    Public dwServerEapTypeId As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public fMultilink As Boolean
    Public dwTerminateReason As UInteger
    Public dwServerTerminateReason As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1024)> Public szReplyMessage As String
    Public dwOptions As UInteger
    Public dwServerOptions As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RASPPPLCPW(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("fBundled", wintypes.BOOL),
        ("dwError", wintypes.DWORD),
        ("dwAuthenticationProtocol", wintypes.DWORD),
        ("dwAuthenticationData", wintypes.DWORD),
        ("dwEapTypeId", wintypes.DWORD),
        ("dwServerAuthenticationProtocol", wintypes.DWORD),
        ("dwServerAuthenticationData", wintypes.DWORD),
        ("dwServerEapTypeId", wintypes.DWORD),
        ("fMultilink", wintypes.BOOL),
        ("dwTerminateReason", wintypes.DWORD),
        ("dwServerTerminateReason", wintypes.DWORD),
        ("szReplyMessage", ctypes.c_wchar * 1024),
        ("dwOptions", wintypes.DWORD),
        ("dwServerOptions", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RASPPPLCPW {
    pub dwSize: u32,
    pub fBundled: i32,
    pub dwError: u32,
    pub dwAuthenticationProtocol: u32,
    pub dwAuthenticationData: u32,
    pub dwEapTypeId: u32,
    pub dwServerAuthenticationProtocol: u32,
    pub dwServerAuthenticationData: u32,
    pub dwServerEapTypeId: u32,
    pub fMultilink: i32,
    pub dwTerminateReason: u32,
    pub dwServerTerminateReason: u32,
    pub szReplyMessage: [u16; 1024],
    pub dwOptions: u32,
    pub dwServerOptions: u32,
}
import "golang.org/x/sys/windows"

type RASPPPLCPW struct {
	dwSize uint32
	fBundled int32
	dwError uint32
	dwAuthenticationProtocol uint32
	dwAuthenticationData uint32
	dwEapTypeId uint32
	dwServerAuthenticationProtocol uint32
	dwServerAuthenticationData uint32
	dwServerEapTypeId uint32
	fMultilink int32
	dwTerminateReason uint32
	dwServerTerminateReason uint32
	szReplyMessage [1024]uint16
	dwOptions uint32
	dwServerOptions uint32
}
type
  RASPPPLCPW = record
    dwSize: DWORD;
    fBundled: BOOL;
    dwError: DWORD;
    dwAuthenticationProtocol: DWORD;
    dwAuthenticationData: DWORD;
    dwEapTypeId: DWORD;
    dwServerAuthenticationProtocol: DWORD;
    dwServerAuthenticationData: DWORD;
    dwServerEapTypeId: DWORD;
    fMultilink: BOOL;
    dwTerminateReason: DWORD;
    dwServerTerminateReason: DWORD;
    szReplyMessage: array[0..1023] of WideChar;
    dwOptions: DWORD;
    dwServerOptions: DWORD;
  end;
const RASPPPLCPW = extern struct {
    dwSize: u32,
    fBundled: i32,
    dwError: u32,
    dwAuthenticationProtocol: u32,
    dwAuthenticationData: u32,
    dwEapTypeId: u32,
    dwServerAuthenticationProtocol: u32,
    dwServerAuthenticationData: u32,
    dwServerEapTypeId: u32,
    fMultilink: i32,
    dwTerminateReason: u32,
    dwServerTerminateReason: u32,
    szReplyMessage: [1024]u16,
    dwOptions: u32,
    dwServerOptions: u32,
};
type
  RASPPPLCPW {.bycopy.} = object
    dwSize: uint32
    fBundled: int32
    dwError: uint32
    dwAuthenticationProtocol: uint32
    dwAuthenticationData: uint32
    dwEapTypeId: uint32
    dwServerAuthenticationProtocol: uint32
    dwServerAuthenticationData: uint32
    dwServerEapTypeId: uint32
    fMultilink: int32
    dwTerminateReason: uint32
    dwServerTerminateReason: uint32
    szReplyMessage: array[1024, uint16]
    dwOptions: uint32
    dwServerOptions: uint32
struct RASPPPLCPW
{
    uint dwSize;
    int fBundled;
    uint dwError;
    uint dwAuthenticationProtocol;
    uint dwAuthenticationData;
    uint dwEapTypeId;
    uint dwServerAuthenticationProtocol;
    uint dwServerAuthenticationData;
    uint dwServerEapTypeId;
    int fMultilink;
    uint dwTerminateReason;
    uint dwServerTerminateReason;
    wchar[1024] szReplyMessage;
    uint dwOptions;
    uint dwServerOptions;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RASPPPLCPW サイズ: 2104 バイト(x64)
dim st, 526    ; 4byte整数×526(構造体サイズ 2104 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fBundled : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwError : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwAuthenticationProtocol : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwAuthenticationData : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwServerAuthenticationProtocol : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwServerAuthenticationData : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwServerEapTypeId : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; fMultilink : BOOL (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwTerminateReason : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwServerTerminateReason : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; szReplyMessage : WCHAR (+48, 2048byte)  varptr(st)+48 を基点に操作(2048byte:入れ子/配列)
; dwOptions : DWORD (+2096, 4byte)  st.524 = 値  /  値 = st.524   (lpoke/lpeek も可)
; dwServerOptions : DWORD (+2100, 4byte)  st.525 = 値  /  値 = st.525   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RASPPPLCPW
    #field int dwSize
    #field bool fBundled
    #field int dwError
    #field int dwAuthenticationProtocol
    #field int dwAuthenticationData
    #field int dwEapTypeId
    #field int dwServerAuthenticationProtocol
    #field int dwServerAuthenticationData
    #field int dwServerEapTypeId
    #field bool fMultilink
    #field int dwTerminateReason
    #field int dwServerTerminateReason
    #field wchar szReplyMessage 1024
    #field int dwOptions
    #field int dwServerOptions
#endstruct

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