ホーム › NetworkManagement.Rras › PPP_LCP_INFO
PPP_LCP_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwError | DWORD | 4 | +0 | +0 | LCP(リンク制御プロトコル)のエラーコード。0なら正常。 |
| dwAuthenticationProtocol | PPP_LCP | 4 | +4 | +4 | 使用された認証プロトコル(PPP_LCP列挙値)。 |
| dwAuthenticationData | PPP_LCP_INFO_AUTH_DATA | 4 | +8 | +8 | 使用された認証データ種別(PPP_LCP_INFO_AUTH_DATA)。 |
| dwRemoteAuthenticationProtocol | DWORD | 4 | +12 | +12 | リモートが使用した認証プロトコル。 |
| dwRemoteAuthenticationData | DWORD | 4 | +16 | +16 | リモートの認証データ種別。 |
| dwTerminateReason | DWORD | 4 | +20 | +20 | ローカル側のリンク終了理由コード。 |
| dwRemoteTerminateReason | DWORD | 4 | +24 | +24 | リモート側のリンク終了理由コード。 |
| dwOptions | DWORD | 4 | +28 | +28 | ローカルのLCPオプションフラグ。 |
| dwRemoteOptions | DWORD | 4 | +32 | +32 | リモートのLCPオプションフラグ。 |
| dwEapTypeId | DWORD | 4 | +36 | +36 | ローカルのEAPタイプ識別子。 |
| dwRemoteEapTypeId | DWORD | 4 | +40 | +40 | リモートのEAPタイプ識別子。 |
各言語での定義
#include <windows.h>
// PPP_LCP_INFO (x64 44 / x86 44 バイト)
typedef struct PPP_LCP_INFO {
DWORD dwError;
PPP_LCP dwAuthenticationProtocol;
PPP_LCP_INFO_AUTH_DATA dwAuthenticationData;
DWORD dwRemoteAuthenticationProtocol;
DWORD dwRemoteAuthenticationData;
DWORD dwTerminateReason;
DWORD dwRemoteTerminateReason;
DWORD dwOptions;
DWORD dwRemoteOptions;
DWORD dwEapTypeId;
DWORD dwRemoteEapTypeId;
} PPP_LCP_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_LCP_INFO
{
public uint dwError;
public uint dwAuthenticationProtocol;
public uint dwAuthenticationData;
public uint dwRemoteAuthenticationProtocol;
public uint dwRemoteAuthenticationData;
public uint dwTerminateReason;
public uint dwRemoteTerminateReason;
public uint dwOptions;
public uint dwRemoteOptions;
public uint dwEapTypeId;
public uint dwRemoteEapTypeId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_LCP_INFO
Public dwError As UInteger
Public dwAuthenticationProtocol As UInteger
Public dwAuthenticationData As UInteger
Public dwRemoteAuthenticationProtocol As UInteger
Public dwRemoteAuthenticationData As UInteger
Public dwTerminateReason As UInteger
Public dwRemoteTerminateReason As UInteger
Public dwOptions As UInteger
Public dwRemoteOptions As UInteger
Public dwEapTypeId As UInteger
Public dwRemoteEapTypeId As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PPP_LCP_INFO(ctypes.Structure):
_fields_ = [
("dwError", wintypes.DWORD),
("dwAuthenticationProtocol", wintypes.DWORD),
("dwAuthenticationData", wintypes.DWORD),
("dwRemoteAuthenticationProtocol", wintypes.DWORD),
("dwRemoteAuthenticationData", wintypes.DWORD),
("dwTerminateReason", wintypes.DWORD),
("dwRemoteTerminateReason", wintypes.DWORD),
("dwOptions", wintypes.DWORD),
("dwRemoteOptions", wintypes.DWORD),
("dwEapTypeId", wintypes.DWORD),
("dwRemoteEapTypeId", wintypes.DWORD),
]#[repr(C)]
pub struct PPP_LCP_INFO {
pub dwError: u32,
pub dwAuthenticationProtocol: u32,
pub dwAuthenticationData: u32,
pub dwRemoteAuthenticationProtocol: u32,
pub dwRemoteAuthenticationData: u32,
pub dwTerminateReason: u32,
pub dwRemoteTerminateReason: u32,
pub dwOptions: u32,
pub dwRemoteOptions: u32,
pub dwEapTypeId: u32,
pub dwRemoteEapTypeId: u32,
}import "golang.org/x/sys/windows"
type PPP_LCP_INFO struct {
dwError uint32
dwAuthenticationProtocol uint32
dwAuthenticationData uint32
dwRemoteAuthenticationProtocol uint32
dwRemoteAuthenticationData uint32
dwTerminateReason uint32
dwRemoteTerminateReason uint32
dwOptions uint32
dwRemoteOptions uint32
dwEapTypeId uint32
dwRemoteEapTypeId uint32
}type
PPP_LCP_INFO = record
dwError: DWORD;
dwAuthenticationProtocol: DWORD;
dwAuthenticationData: DWORD;
dwRemoteAuthenticationProtocol: DWORD;
dwRemoteAuthenticationData: DWORD;
dwTerminateReason: DWORD;
dwRemoteTerminateReason: DWORD;
dwOptions: DWORD;
dwRemoteOptions: DWORD;
dwEapTypeId: DWORD;
dwRemoteEapTypeId: DWORD;
end;const PPP_LCP_INFO = extern struct {
dwError: u32,
dwAuthenticationProtocol: u32,
dwAuthenticationData: u32,
dwRemoteAuthenticationProtocol: u32,
dwRemoteAuthenticationData: u32,
dwTerminateReason: u32,
dwRemoteTerminateReason: u32,
dwOptions: u32,
dwRemoteOptions: u32,
dwEapTypeId: u32,
dwRemoteEapTypeId: u32,
};type
PPP_LCP_INFO {.bycopy.} = object
dwError: uint32
dwAuthenticationProtocol: uint32
dwAuthenticationData: uint32
dwRemoteAuthenticationProtocol: uint32
dwRemoteAuthenticationData: uint32
dwTerminateReason: uint32
dwRemoteTerminateReason: uint32
dwOptions: uint32
dwRemoteOptions: uint32
dwEapTypeId: uint32
dwRemoteEapTypeId: uint32struct PPP_LCP_INFO
{
uint dwError;
uint dwAuthenticationProtocol;
uint dwAuthenticationData;
uint dwRemoteAuthenticationProtocol;
uint dwRemoteAuthenticationData;
uint dwTerminateReason;
uint dwRemoteTerminateReason;
uint dwOptions;
uint dwRemoteOptions;
uint dwEapTypeId;
uint dwRemoteEapTypeId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PPP_LCP_INFO サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwError : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwAuthenticationProtocol : PPP_LCP (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwAuthenticationData : PPP_LCP_INFO_AUTH_DATA (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwRemoteAuthenticationProtocol : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwRemoteAuthenticationData : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwTerminateReason : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwRemoteTerminateReason : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwOptions : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwRemoteOptions : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwRemoteEapTypeId : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PPP_LCP_INFO
#field int dwError
#field int dwAuthenticationProtocol
#field int dwAuthenticationData
#field int dwRemoteAuthenticationProtocol
#field int dwRemoteAuthenticationData
#field int dwTerminateReason
#field int dwRemoteTerminateReason
#field int dwOptions
#field int dwRemoteOptions
#field int dwEapTypeId
#field int dwRemoteEapTypeId
#endstruct
stdim st, PPP_LCP_INFO ; NSTRUCT 変数を確保
st->dwError = 100
mes "dwError=" + st->dwError