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

PPP_PROJECTION_INFO2

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

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

フィールド

フィールドサイズx64x86説明
dwIPv4NegotiationErrorDWORD4+0+0PPP IPv4 ネットワーク制御プロトコルのネゴシエーション結果を指定する値です。値が 0 の場合は、IPv4 のネゴシエーションが成功したことを示します。0 以外の値は失敗を示し、制御プロトコルのネゴシエーション中に発生した致命的なエラーを表します。
wszAddressWCHAR32+4+4ローカルクライアントの IPv4 アドレスを指定する、null で終わる Unicode 文字列です。この文字列は "a.b.c.d" の形式です。wszAddress メンバーは、dwIPv4NegotiationError が 0 の場合にのみ有効です。
wszRemoteAddressWCHAR32+36+36リモートサーバーの IPv4 アドレスを指定する Unicode 文字列を格納する配列です。この文字列は "a.b.c.d" の形式です。wszRemoteAddress メンバーは、dwIPv4NegotiationError メンバーが 0 の場合にのみ有効です。アドレスが利用できない場合、このメンバーは空文字列になります。
dwIPv4OptionsDWORD4+68+68

ローカルクライアントの IPCP オプションを指定する値です。

意味
PPP_IPCP_VJ
ローカルクライアントが送信する IP データグラムが Van Jacobson 圧縮で圧縮されることを示します。
dwIPv4RemoteOptionsDWORD4+72+72

リモートサーバーの IPCP オプションを指定する値です。

意味
PPP_IPCP_VJ
リモートサーバーが送信する (つまりローカルコンピューターが受信する) IP データグラムが Van Jacobson 圧縮で圧縮されることを示します。
IPv4SubInterfaceIndexULONGLONG8+80+80サーバー上の接続に対応する IPv4 サブインターフェイスのインデックスを指定する値です。
dwIPv6NegotiationErrorDWORD4+88+88PPP IPv6 ネットワーク制御プロトコルのネゴシエーション結果を指定する値です。値が 0 の場合は、IPv6 のネゴシエーションが成功したことを示します。0 以外の値は失敗を示し、制御プロトコルのネゴシエーション中に発生した致命的なエラーを表します。
bInterfaceIdentifierBYTE8+92+92クライアントの 64 ビット IPv6 インターフェイス識別子を指定する配列です。128 ビットの IPv6 インターネットアドレスの下位 64 ビットはインターフェイス識別子と見なされ、先行する 64 ビットに対して高い一意性を提供します。bInterfaceIdentifier メンバーは 0 であってはならず、dwIPv6NegotiationError メンバーが 0 の場合にのみ有効です。
bRemoteInterfaceIdentifierBYTE8+100+100サーバーの 64 ビット IPv6 インターフェイス識別子を指定する配列です。128 ビットの IPv6 インターネットアドレスの下位 64 ビットはインターフェイス識別子と見なされ、先行する 64 ビットに対して高い一意性を提供します。bInterfaceIdentifier メンバーは 0 であってはならず、dwIPv6NegotiationError メンバーが 0 の場合にのみ有効です。
bPrefixBYTE8+108+108クライアントインターフェイスの IPv6 アドレスプレフィックスを指定する値です。
dwPrefixLengthDWORD4+116+116bPrefix メンバーの長さをビット単位で指定する値です。
IPv6SubInterfaceIndexULONGLONG8+120+120サーバー上の接続に対応する IPv6 サブインターフェイスのインデックスを指定する値です。
dwLcpErrorDWORD4+128+128PPP LCP ネゴシエーションの結果を指定する値です。値が 0 の場合は、LCP のネゴシエーションが成功したことを示します。0 以外の値は失敗を示し、制御プロトコルのネゴシエーション中に発生した致命的なエラーを表します。
dwAuthenticationProtocolPPP_LCP4+132+132

ローカルクライアントの認証に使用される認証プロトコルを指定する値です。このメンバーには次のいずれかの値を指定できます。

意味
PPP_LCP_PAP
パスワード認証プロトコル (Password Authentication Protocol)
PPP_LCP_CHAP
チャレンジハンドシェイク認証プロトコル (Challenge Handshake Authentication Protocol)
PPP_LCP_EAP
拡張認証プロトコル (Extensible Authentication Protocol)
dwAuthenticationDataPPP_LCP_INFO_AUTH_DATA4+136+136

dwAuthenticationProtocol メンバーで指定された認証プロトコルに関する追加情報を指定する値です。このメンバーには次のいずれかの値を指定できます。

意味
PPP_LCP_CHAP_MD5
MD5 CHAP
PPP_LCP_CHAP_MS
Microsoft CHAP
PPP_LCP_CHAP_MSV2
Microsoft CHAP バージョン 2
dwRemoteAuthenticationProtocolPPP_LCP4+140+140

リモートサーバーの認証に使用される認証プロトコルを指定する値です。デマンドダイヤルでクライアントとサーバーが異なる認証プロトコルを使用する場合、dwAuthenticationProtocol メンバーと dwRemoteAuthenticationProtocol メンバーの値は異なります。このメンバーには次のいずれかの値を指定できます。

意味
PPP_LCP_PAP
パスワード認証プロトコル (Password Authentication Protocol)
PPP_LCP_CHAP
チャレンジハンドシェイク認証プロトコル (Challenge Handshake Authentication Protocol)
PPP_LCP_EAP
拡張認証プロトコル (Extensible Authentication Protocol)
dwRemoteAuthenticationDataPPP_LCP_INFO_AUTH_DATA4+144+144

dwRemoteAuthenticationProtocol メンバーで指定された認証プロトコルに関する追加情報を指定する値です。デマンドダイヤルでクライアントとサーバーが異なる認証プロトコルを使用する場合、dwAuthenticationData メンバーと dwRemoteAuthenticationData メンバーの値は異なります。このメンバーには次のいずれかの値を指定できます。

意味
PPP_LCP_CHAP_MD5
MD5 CHAP
PPP_LCP_CHAP_MS
Microsoft CHAP
PPP_LCP_CHAP_MSV2
Microsoft CHAP バージョン 2
dwLcpTerminateReasonDWORD4+148+148実装されていません。0 でなければなりません。
dwLcpRemoteTerminateReasonDWORD4+152+152実装されていません。0 でなければなりません。
dwLcpOptionsDWORD4+156+156

ローカルクライアントが使用している LCP オプションに関する情報を指定する値です。このメンバーは次のフラグの組み合わせです。

意味
PPP_LCP_MULTILINK_FRAMING
接続はマルチリンクを使用しています。
PPP_LCP_PFC
接続は Protocol Field Compression を使用しています。
PPP_LCP_ACFC
接続は Address and Control Field Compression を使用しています。
PPP_LCP_SSHF
接続は Short Sequence Number Header Format を使用しています。
PPP_LCP_DES_56
接続は DES 56 ビット暗号化を使用しています。
PPP_LCP_3_DES
接続はトリプル DES 暗号化を使用しています。
PPP_LCP_AES_128
接続は 128 ビット AES 暗号化を使用しています。
PPP_LCP_AES_256
接続は 256 ビット AES 暗号化を使用しています。
dwLcpRemoteOptionsDWORD4+160+160

リモートサーバーが使用している LCP オプションに関する情報を指定する値です。このメンバーは次のフラグの組み合わせです。

意味
PPP_LCP_MULTILINK_FRAMING
接続はマルチリンクを使用しています。
PPP_LCP_PFC
接続は Protocol Field Compression を使用しています。
PPP_LCP_ACFC
接続は Address and Control Field Compression を使用しています。
PPP_LCP_SSHF
接続は Short Sequence Number Header Format を使用しています。
PPP_LCP_DES_56
接続は DES 56 ビット暗号化を使用しています。
PPP_LCP_3_DES
接続はトリプル DES 暗号化を使用しています。
PPP_LCP_AES_128
接続は 128 ビット AES 暗号化を使用しています。
PPP_LCP_AES_256
接続は 256 ビット AES 暗号化を使用しています。
dwEapTypeIdDWORD4+164+164ローカルクライアントの認証に使用される拡張認証プロトコル (EAP) の型識別子を指定する値です。このメンバーの値は、dwAuthenticationProtocol メンバーが PPP_LCP_EAP の場合にのみ有効です。
dwEmbeddedEAPTypeIdDWORD4+168+168EAP 認証で使用される内部 EAP メソッドの型識別子を指定する値です。このメンバーの値は、dwEapTypeId メンバーに IANA-EAP で定義された PEAP が設定されている場合にのみ有効です。
dwRemoteEapTypeIdDWORD4+172+172リモートサーバーの認証に使用される拡張認証プロトコル (EAP) の型識別子を指定する値です。このメンバーの値は、dwRemoteAuthenticationProtocol メンバーが PPP_LCP_EAP の場合にのみ有効です。
dwCcpErrorDWORD4+176+176PPP CCP ネゴシエーションの結果を指定する値です。値が 0 の場合は、CCP のネゴシエーションが成功したことを示します。0 以外の値は失敗を示し、制御プロトコルのネゴシエーション中に発生した致命的なエラーを表します。
dwCompressionAlgorithmDWORD4+180+180

ローカルクライアントが使用する圧縮アルゴリズムを指定する値です。次の表に、このメンバーに指定できる値を示します。

意味
RASCCPCA_MPPC
Microsoft Point-to-Point Compression (MPPC) プロトコル。
RASCCPCA_STAC
STAC オプション 4。
dwCcpOptionsDWORD4+184+184

ローカルクライアントで利用できる圧縮の種類を指定する値です。次の種類がサポートされています。

意味
PPP_CCP_COMPRESSION
暗号化を伴わない圧縮。
PPP_CCP_HISTORYLESS
ステートレスモードの Microsoft Point-to-Point Encryption (MPPE)。セッションキーはパケットごとに変更されます。このモードは、遅延の大きいネットワークやパケット損失が著しいネットワークでパフォーマンスを向上させます。
PPP_CCP_ENCRYPTION40BITOLD
40 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION40BIT
40 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION56BIT
56 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION128BIT
128 ビットキーを使用する MPPE 圧縮。

最後の 3 つのオプションは、Layer 2 Tunneling Protocol (L2TP) 経由で接続が確立され、その接続が IPSec 暗号化を使用する場合に使用されます。

dwRemoteCompressionAlgorithmDWORD4+188+188

リモートサーバーが使用する圧縮アルゴリズムを指定する値です。次のアルゴリズムがサポートされています。

意味
RASCCPCA_MPPC
Microsoft Point-to-Point Compression (MPPC) プロトコル。
RASCCPCA_STAC
STAC オプション 4。
dwCcpRemoteOptionsDWORD4+192+192

リモートサーバーで利用できる圧縮の種類を指定する値です。次の種類がサポートされています。

意味
PPP_CCP_COMPRESSION
暗号化を伴わない圧縮。
PPP_CCP_HISTORYLESS
ステートレスモードの Microsoft Point-to-Point Encryption (MPPE)。セッションキーはパケットごとに変更されます。このモードは、遅延の大きいネットワークやパケット損失が著しいネットワークでパフォーマンスを向上させます。
PPP_CCP_ENCRYPTION40BITOLD
40 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION40BIT
40 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION56BIT
56 ビットキーを使用する MPPE 圧縮。
PPP_CCP_ENCRYPTION128BIT
128 ビットキーを使用する MPPE 圧縮。
ERROR_PPP_NOT_CONVERGING
リモートコンピューターと RRAS がアドレスのネゴシエーションで収束できませんでした。

最後の 3 つのオプションは、Layer 2 Tunneling Protocol (L2TP) 経由で接続が確立され、その接続が IPSec 暗号化を使用する場合に使用されます。

公式ドキュメント

Secure Socket Tunneling Protocol (SSTP)、Point-to-Point Tunneling Protocol (PPTP)、および Layer 2 Tunneling Protocol (L2TP) の Point-to-Point (PPP) ネゴシエーション中に取得された情報を格納します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// PPP_PROJECTION_INFO2  (x64 200 / x86 200 バイト)
typedef struct PPP_PROJECTION_INFO2 {
    DWORD dwIPv4NegotiationError;
    WCHAR wszAddress[16];
    WCHAR wszRemoteAddress[16];
    DWORD dwIPv4Options;
    DWORD dwIPv4RemoteOptions;
    ULONGLONG IPv4SubInterfaceIndex;
    DWORD dwIPv6NegotiationError;
    BYTE bInterfaceIdentifier[8];
    BYTE bRemoteInterfaceIdentifier[8];
    BYTE bPrefix[8];
    DWORD dwPrefixLength;
    ULONGLONG IPv6SubInterfaceIndex;
    DWORD dwLcpError;
    PPP_LCP dwAuthenticationProtocol;
    PPP_LCP_INFO_AUTH_DATA dwAuthenticationData;
    PPP_LCP dwRemoteAuthenticationProtocol;
    PPP_LCP_INFO_AUTH_DATA dwRemoteAuthenticationData;
    DWORD dwLcpTerminateReason;
    DWORD dwLcpRemoteTerminateReason;
    DWORD dwLcpOptions;
    DWORD dwLcpRemoteOptions;
    DWORD dwEapTypeId;
    DWORD dwEmbeddedEAPTypeId;
    DWORD dwRemoteEapTypeId;
    DWORD dwCcpError;
    DWORD dwCompressionAlgorithm;
    DWORD dwCcpOptions;
    DWORD dwRemoteCompressionAlgorithm;
    DWORD dwCcpRemoteOptions;
} PPP_PROJECTION_INFO2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_PROJECTION_INFO2
{
    public uint dwIPv4NegotiationError;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string wszAddress;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string wszRemoteAddress;
    public uint dwIPv4Options;
    public uint dwIPv4RemoteOptions;
    public ulong IPv4SubInterfaceIndex;
    public uint dwIPv6NegotiationError;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bInterfaceIdentifier;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bRemoteInterfaceIdentifier;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bPrefix;
    public uint dwPrefixLength;
    public ulong IPv6SubInterfaceIndex;
    public uint dwLcpError;
    public uint dwAuthenticationProtocol;
    public uint dwAuthenticationData;
    public uint dwRemoteAuthenticationProtocol;
    public uint dwRemoteAuthenticationData;
    public uint dwLcpTerminateReason;
    public uint dwLcpRemoteTerminateReason;
    public uint dwLcpOptions;
    public uint dwLcpRemoteOptions;
    public uint dwEapTypeId;
    public uint dwEmbeddedEAPTypeId;
    public uint dwRemoteEapTypeId;
    public uint dwCcpError;
    public uint dwCompressionAlgorithm;
    public uint dwCcpOptions;
    public uint dwRemoteCompressionAlgorithm;
    public uint dwCcpRemoteOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_PROJECTION_INFO2
    Public dwIPv4NegotiationError As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public wszAddress As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public wszRemoteAddress As String
    Public dwIPv4Options As UInteger
    Public dwIPv4RemoteOptions As UInteger
    Public IPv4SubInterfaceIndex As ULong
    Public dwIPv6NegotiationError As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bInterfaceIdentifier() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bRemoteInterfaceIdentifier() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bPrefix() As Byte
    Public dwPrefixLength As UInteger
    Public IPv6SubInterfaceIndex As ULong
    Public dwLcpError As UInteger
    Public dwAuthenticationProtocol As UInteger
    Public dwAuthenticationData As UInteger
    Public dwRemoteAuthenticationProtocol As UInteger
    Public dwRemoteAuthenticationData As UInteger
    Public dwLcpTerminateReason As UInteger
    Public dwLcpRemoteTerminateReason As UInteger
    Public dwLcpOptions As UInteger
    Public dwLcpRemoteOptions As UInteger
    Public dwEapTypeId As UInteger
    Public dwEmbeddedEAPTypeId As UInteger
    Public dwRemoteEapTypeId As UInteger
    Public dwCcpError As UInteger
    Public dwCompressionAlgorithm As UInteger
    Public dwCcpOptions As UInteger
    Public dwRemoteCompressionAlgorithm As UInteger
    Public dwCcpRemoteOptions As UInteger
End Structure
import ctypes
from ctypes import wintypes

class PPP_PROJECTION_INFO2(ctypes.Structure):
    _fields_ = [
        ("dwIPv4NegotiationError", wintypes.DWORD),
        ("wszAddress", ctypes.c_wchar * 16),
        ("wszRemoteAddress", ctypes.c_wchar * 16),
        ("dwIPv4Options", wintypes.DWORD),
        ("dwIPv4RemoteOptions", wintypes.DWORD),
        ("IPv4SubInterfaceIndex", ctypes.c_ulonglong),
        ("dwIPv6NegotiationError", wintypes.DWORD),
        ("bInterfaceIdentifier", ctypes.c_ubyte * 8),
        ("bRemoteInterfaceIdentifier", ctypes.c_ubyte * 8),
        ("bPrefix", ctypes.c_ubyte * 8),
        ("dwPrefixLength", wintypes.DWORD),
        ("IPv6SubInterfaceIndex", ctypes.c_ulonglong),
        ("dwLcpError", wintypes.DWORD),
        ("dwAuthenticationProtocol", wintypes.DWORD),
        ("dwAuthenticationData", wintypes.DWORD),
        ("dwRemoteAuthenticationProtocol", wintypes.DWORD),
        ("dwRemoteAuthenticationData", wintypes.DWORD),
        ("dwLcpTerminateReason", wintypes.DWORD),
        ("dwLcpRemoteTerminateReason", wintypes.DWORD),
        ("dwLcpOptions", wintypes.DWORD),
        ("dwLcpRemoteOptions", wintypes.DWORD),
        ("dwEapTypeId", wintypes.DWORD),
        ("dwEmbeddedEAPTypeId", wintypes.DWORD),
        ("dwRemoteEapTypeId", wintypes.DWORD),
        ("dwCcpError", wintypes.DWORD),
        ("dwCompressionAlgorithm", wintypes.DWORD),
        ("dwCcpOptions", wintypes.DWORD),
        ("dwRemoteCompressionAlgorithm", wintypes.DWORD),
        ("dwCcpRemoteOptions", wintypes.DWORD),
    ]
#[repr(C)]
pub struct PPP_PROJECTION_INFO2 {
    pub dwIPv4NegotiationError: u32,
    pub wszAddress: [u16; 16],
    pub wszRemoteAddress: [u16; 16],
    pub dwIPv4Options: u32,
    pub dwIPv4RemoteOptions: u32,
    pub IPv4SubInterfaceIndex: u64,
    pub dwIPv6NegotiationError: u32,
    pub bInterfaceIdentifier: [u8; 8],
    pub bRemoteInterfaceIdentifier: [u8; 8],
    pub bPrefix: [u8; 8],
    pub dwPrefixLength: u32,
    pub IPv6SubInterfaceIndex: u64,
    pub dwLcpError: u32,
    pub dwAuthenticationProtocol: u32,
    pub dwAuthenticationData: u32,
    pub dwRemoteAuthenticationProtocol: u32,
    pub dwRemoteAuthenticationData: u32,
    pub dwLcpTerminateReason: u32,
    pub dwLcpRemoteTerminateReason: u32,
    pub dwLcpOptions: u32,
    pub dwLcpRemoteOptions: u32,
    pub dwEapTypeId: u32,
    pub dwEmbeddedEAPTypeId: u32,
    pub dwRemoteEapTypeId: u32,
    pub dwCcpError: u32,
    pub dwCompressionAlgorithm: u32,
    pub dwCcpOptions: u32,
    pub dwRemoteCompressionAlgorithm: u32,
    pub dwCcpRemoteOptions: u32,
}
import "golang.org/x/sys/windows"

type PPP_PROJECTION_INFO2 struct {
	dwIPv4NegotiationError uint32
	wszAddress [16]uint16
	wszRemoteAddress [16]uint16
	dwIPv4Options uint32
	dwIPv4RemoteOptions uint32
	IPv4SubInterfaceIndex uint64
	dwIPv6NegotiationError uint32
	bInterfaceIdentifier [8]byte
	bRemoteInterfaceIdentifier [8]byte
	bPrefix [8]byte
	dwPrefixLength uint32
	IPv6SubInterfaceIndex uint64
	dwLcpError uint32
	dwAuthenticationProtocol uint32
	dwAuthenticationData uint32
	dwRemoteAuthenticationProtocol uint32
	dwRemoteAuthenticationData uint32
	dwLcpTerminateReason uint32
	dwLcpRemoteTerminateReason uint32
	dwLcpOptions uint32
	dwLcpRemoteOptions uint32
	dwEapTypeId uint32
	dwEmbeddedEAPTypeId uint32
	dwRemoteEapTypeId uint32
	dwCcpError uint32
	dwCompressionAlgorithm uint32
	dwCcpOptions uint32
	dwRemoteCompressionAlgorithm uint32
	dwCcpRemoteOptions uint32
}
type
  PPP_PROJECTION_INFO2 = record
    dwIPv4NegotiationError: DWORD;
    wszAddress: array[0..15] of WideChar;
    wszRemoteAddress: array[0..15] of WideChar;
    dwIPv4Options: DWORD;
    dwIPv4RemoteOptions: DWORD;
    IPv4SubInterfaceIndex: UInt64;
    dwIPv6NegotiationError: DWORD;
    bInterfaceIdentifier: array[0..7] of Byte;
    bRemoteInterfaceIdentifier: array[0..7] of Byte;
    bPrefix: array[0..7] of Byte;
    dwPrefixLength: DWORD;
    IPv6SubInterfaceIndex: UInt64;
    dwLcpError: DWORD;
    dwAuthenticationProtocol: DWORD;
    dwAuthenticationData: DWORD;
    dwRemoteAuthenticationProtocol: DWORD;
    dwRemoteAuthenticationData: DWORD;
    dwLcpTerminateReason: DWORD;
    dwLcpRemoteTerminateReason: DWORD;
    dwLcpOptions: DWORD;
    dwLcpRemoteOptions: DWORD;
    dwEapTypeId: DWORD;
    dwEmbeddedEAPTypeId: DWORD;
    dwRemoteEapTypeId: DWORD;
    dwCcpError: DWORD;
    dwCompressionAlgorithm: DWORD;
    dwCcpOptions: DWORD;
    dwRemoteCompressionAlgorithm: DWORD;
    dwCcpRemoteOptions: DWORD;
  end;
const PPP_PROJECTION_INFO2 = extern struct {
    dwIPv4NegotiationError: u32,
    wszAddress: [16]u16,
    wszRemoteAddress: [16]u16,
    dwIPv4Options: u32,
    dwIPv4RemoteOptions: u32,
    IPv4SubInterfaceIndex: u64,
    dwIPv6NegotiationError: u32,
    bInterfaceIdentifier: [8]u8,
    bRemoteInterfaceIdentifier: [8]u8,
    bPrefix: [8]u8,
    dwPrefixLength: u32,
    IPv6SubInterfaceIndex: u64,
    dwLcpError: u32,
    dwAuthenticationProtocol: u32,
    dwAuthenticationData: u32,
    dwRemoteAuthenticationProtocol: u32,
    dwRemoteAuthenticationData: u32,
    dwLcpTerminateReason: u32,
    dwLcpRemoteTerminateReason: u32,
    dwLcpOptions: u32,
    dwLcpRemoteOptions: u32,
    dwEapTypeId: u32,
    dwEmbeddedEAPTypeId: u32,
    dwRemoteEapTypeId: u32,
    dwCcpError: u32,
    dwCompressionAlgorithm: u32,
    dwCcpOptions: u32,
    dwRemoteCompressionAlgorithm: u32,
    dwCcpRemoteOptions: u32,
};
type
  PPP_PROJECTION_INFO2 {.bycopy.} = object
    dwIPv4NegotiationError: uint32
    wszAddress: array[16, uint16]
    wszRemoteAddress: array[16, uint16]
    dwIPv4Options: uint32
    dwIPv4RemoteOptions: uint32
    IPv4SubInterfaceIndex: uint64
    dwIPv6NegotiationError: uint32
    bInterfaceIdentifier: array[8, uint8]
    bRemoteInterfaceIdentifier: array[8, uint8]
    bPrefix: array[8, uint8]
    dwPrefixLength: uint32
    IPv6SubInterfaceIndex: uint64
    dwLcpError: uint32
    dwAuthenticationProtocol: uint32
    dwAuthenticationData: uint32
    dwRemoteAuthenticationProtocol: uint32
    dwRemoteAuthenticationData: uint32
    dwLcpTerminateReason: uint32
    dwLcpRemoteTerminateReason: uint32
    dwLcpOptions: uint32
    dwLcpRemoteOptions: uint32
    dwEapTypeId: uint32
    dwEmbeddedEAPTypeId: uint32
    dwRemoteEapTypeId: uint32
    dwCcpError: uint32
    dwCompressionAlgorithm: uint32
    dwCcpOptions: uint32
    dwRemoteCompressionAlgorithm: uint32
    dwCcpRemoteOptions: uint32
struct PPP_PROJECTION_INFO2
{
    uint dwIPv4NegotiationError;
    wchar[16] wszAddress;
    wchar[16] wszRemoteAddress;
    uint dwIPv4Options;
    uint dwIPv4RemoteOptions;
    ulong IPv4SubInterfaceIndex;
    uint dwIPv6NegotiationError;
    ubyte[8] bInterfaceIdentifier;
    ubyte[8] bRemoteInterfaceIdentifier;
    ubyte[8] bPrefix;
    uint dwPrefixLength;
    ulong IPv6SubInterfaceIndex;
    uint dwLcpError;
    uint dwAuthenticationProtocol;
    uint dwAuthenticationData;
    uint dwRemoteAuthenticationProtocol;
    uint dwRemoteAuthenticationData;
    uint dwLcpTerminateReason;
    uint dwLcpRemoteTerminateReason;
    uint dwLcpOptions;
    uint dwLcpRemoteOptions;
    uint dwEapTypeId;
    uint dwEmbeddedEAPTypeId;
    uint dwRemoteEapTypeId;
    uint dwCcpError;
    uint dwCompressionAlgorithm;
    uint dwCcpOptions;
    uint dwRemoteCompressionAlgorithm;
    uint dwCcpRemoteOptions;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PPP_PROJECTION_INFO2 サイズ: 200 バイト(x64)
dim st, 50    ; 4byte整数×50(構造体サイズ 200 / 4 切り上げ)
; dwIPv4NegotiationError : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; wszAddress : WCHAR (+4, 32byte)  varptr(st)+4 を基点に操作(32byte:入れ子/配列)
; wszRemoteAddress : WCHAR (+36, 32byte)  varptr(st)+36 を基点に操作(32byte:入れ子/配列)
; dwIPv4Options : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; dwIPv4RemoteOptions : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; IPv4SubInterfaceIndex : ULONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; dwIPv6NegotiationError : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; bInterfaceIdentifier : BYTE (+92, 8byte)  varptr(st)+92 を基点に操作(8byte:入れ子/配列)
; bRemoteInterfaceIdentifier : BYTE (+100, 8byte)  varptr(st)+100 を基点に操作(8byte:入れ子/配列)
; bPrefix : BYTE (+108, 8byte)  varptr(st)+108 を基点に操作(8byte:入れ子/配列)
; dwPrefixLength : DWORD (+116, 4byte)  st.29 = 値  /  値 = st.29   (lpoke/lpeek も可)
; IPv6SubInterfaceIndex : ULONGLONG (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; dwLcpError : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; dwAuthenticationProtocol : PPP_LCP (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; dwAuthenticationData : PPP_LCP_INFO_AUTH_DATA (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; dwRemoteAuthenticationProtocol : PPP_LCP (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; dwRemoteAuthenticationData : PPP_LCP_INFO_AUTH_DATA (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; dwLcpTerminateReason : DWORD (+148, 4byte)  st.37 = 値  /  値 = st.37   (lpoke/lpeek も可)
; dwLcpRemoteTerminateReason : DWORD (+152, 4byte)  st.38 = 値  /  値 = st.38   (lpoke/lpeek も可)
; dwLcpOptions : DWORD (+156, 4byte)  st.39 = 値  /  値 = st.39   (lpoke/lpeek も可)
; dwLcpRemoteOptions : DWORD (+160, 4byte)  st.40 = 値  /  値 = st.40   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+164, 4byte)  st.41 = 値  /  値 = st.41   (lpoke/lpeek も可)
; dwEmbeddedEAPTypeId : DWORD (+168, 4byte)  st.42 = 値  /  値 = st.42   (lpoke/lpeek も可)
; dwRemoteEapTypeId : DWORD (+172, 4byte)  st.43 = 値  /  値 = st.43   (lpoke/lpeek も可)
; dwCcpError : DWORD (+176, 4byte)  st.44 = 値  /  値 = st.44   (lpoke/lpeek も可)
; dwCompressionAlgorithm : DWORD (+180, 4byte)  st.45 = 値  /  値 = st.45   (lpoke/lpeek も可)
; dwCcpOptions : DWORD (+184, 4byte)  st.46 = 値  /  値 = st.46   (lpoke/lpeek も可)
; dwRemoteCompressionAlgorithm : DWORD (+188, 4byte)  st.47 = 値  /  値 = st.47   (lpoke/lpeek も可)
; dwCcpRemoteOptions : DWORD (+192, 4byte)  st.48 = 値  /  値 = st.48   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PPP_PROJECTION_INFO2
    #field int dwIPv4NegotiationError
    #field wchar wszAddress 16
    #field wchar wszRemoteAddress 16
    #field int dwIPv4Options
    #field int dwIPv4RemoteOptions
    #field int64 IPv4SubInterfaceIndex
    #field int dwIPv6NegotiationError
    #field byte bInterfaceIdentifier 8
    #field byte bRemoteInterfaceIdentifier 8
    #field byte bPrefix 8
    #field int dwPrefixLength
    #field int64 IPv6SubInterfaceIndex
    #field int dwLcpError
    #field int dwAuthenticationProtocol
    #field int dwAuthenticationData
    #field int dwRemoteAuthenticationProtocol
    #field int dwRemoteAuthenticationData
    #field int dwLcpTerminateReason
    #field int dwLcpRemoteTerminateReason
    #field int dwLcpOptions
    #field int dwLcpRemoteOptions
    #field int dwEapTypeId
    #field int dwEmbeddedEAPTypeId
    #field int dwRemoteEapTypeId
    #field int dwCcpError
    #field int dwCompressionAlgorithm
    #field int dwCcpOptions
    #field int dwRemoteCompressionAlgorithm
    #field int dwCcpRemoteOptions
#endstruct

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