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

MPR_INTERFACE_2

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

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

フィールド

フィールドサイズx64x86説明
wszInterfaceNameWCHAR514+0+0ルーターインターフェイスの名前(ワイド文字列)。
hInterfaceHANDLE8/4+520+516インターフェイスを識別するハンドル。
fEnabledBOOL4+528+520TRUEならインターフェイスが有効であることを示す。
dwIfTypeROUTER_INTERFACE_TYPE4+532+524インターフェイスの種別を表すROUTER_INTERFACE_TYPE列挙値。
dwConnectionStateROUTER_CONNECTION_STATE4+536+528接続状態を表すROUTER_CONNECTION_STATE列挙値。
fUnReachabilityReasonsDWORD4+540+532到達不能の理由を示すフラグ。
dwLastErrorDWORD4+544+536インターフェイスで最後に発生したエラーコード。
dwfOptionsDWORD4+548+540インターフェイスのオプションを示すRASEO_*フラグ。
szLocalPhoneNumberWCHAR258+552+544発信に使用するローカル電話番号(ワイド文字列)。
szAlternatesLPWSTR8/4+816+804代替電話番号のリストへのポインタ(複数文字列)。
ipaddrDWORD4+824+808クライアント固定IPv4アドレス(数値表現)。
ipaddrDnsDWORD4+828+812プライマリDNSサーバーのIPv4アドレス(数値表現)。
ipaddrDnsAltDWORD4+832+816代替DNSサーバーのIPv4アドレス(数値表現)。
ipaddrWinsDWORD4+836+820プライマリWINSサーバーのIPv4アドレス(数値表現)。
ipaddrWinsAltDWORD4+840+824代替WINSサーバーのIPv4アドレス(数値表現)。
dwfNetProtocolsDWORD4+844+828使用するネットワークプロトコルのフラグ(RASNP_*)。
szDeviceTypeWCHAR34+848+832接続に使用するデバイスの種別(ワイド文字列)。
szDeviceNameWCHAR258+882+866接続に使用するデバイスの名前(ワイド文字列)。
szX25PadTypeWCHAR66+1140+1124X.25 PADタイプ(ワイド文字列)。
szX25AddressWCHAR402+1206+1190X.25ネットワークアドレス(ワイド文字列)。
szX25FacilitiesWCHAR402+1608+1592X.25呼設定の追加機能(ワイド文字列)。
szX25UserDataWCHAR402+2010+1994X.25接続時のユーザーデータ(ワイド文字列)。
dwChannelsDWORD4+2412+2396ISDN等で使用するチャネル数。
dwSubEntriesDWORD4+2416+2400このインターフェイスのサブエントリ数。
dwDialModeMPR_INTERFACE_DIAL_MODE4+2420+2404マルチリンクのダイヤル方式(MPR_INTERFACE_DIAL_MODE)。
dwDialExtraPercentDWORD4+2424+2408回線追加発呼の閾値となる帯域使用率(%)。
dwDialExtraSampleSecondsDWORD4+2428+2412回線追加判定の帯域サンプリング秒数。
dwHangUpExtraPercentDWORD4+2432+2416回線切断の閾値となる帯域使用率(%)。
dwHangUpExtraSampleSecondsDWORD4+2436+2420回線切断判定の帯域サンプリング秒数。
dwIdleDisconnectSecondsDWORD4+2440+2424アイドル時に自動切断するまでの秒数。
dwTypeDWORD4+2444+2428インターフェイス/エントリの種別(RASET_*)。
dwEncryptionTypeMPR_ET4+2448+2432データ暗号化の種別を表すMPR_ET列挙値。
dwCustomAuthKeyDWORD4+2452+2436カスタムEAP認証で使用するキー値。
dwCustomAuthDataSizeDWORD4+2456+2440lpbCustomAuthDataが指すデータのバイトサイズ。
lpbCustomAuthDataBYTE*8/4+2464+2444カスタム認証データへのポインタ。NULL可。
guidIdGUID16+2472+2448このインターフェイスを一意に識別するGUID。
dwVpnStrategyMPR_VS4+2488+2464VPNトンネルプロトコル戦略を表すMPR_VS列挙値。

各言語での定義

#include <windows.h>

// MPR_INTERFACE_2  (x64 2496 / x86 2468 バイト)
typedef struct MPR_INTERFACE_2 {
    WCHAR wszInterfaceName[257];
    HANDLE hInterface;
    BOOL fEnabled;
    ROUTER_INTERFACE_TYPE dwIfType;
    ROUTER_CONNECTION_STATE dwConnectionState;
    DWORD fUnReachabilityReasons;
    DWORD dwLastError;
    DWORD dwfOptions;
    WCHAR szLocalPhoneNumber[129];
    LPWSTR szAlternates;
    DWORD ipaddr;
    DWORD ipaddrDns;
    DWORD ipaddrDnsAlt;
    DWORD ipaddrWins;
    DWORD ipaddrWinsAlt;
    DWORD dwfNetProtocols;
    WCHAR szDeviceType[17];
    WCHAR szDeviceName[129];
    WCHAR szX25PadType[33];
    WCHAR szX25Address[201];
    WCHAR szX25Facilities[201];
    WCHAR szX25UserData[201];
    DWORD dwChannels;
    DWORD dwSubEntries;
    MPR_INTERFACE_DIAL_MODE dwDialMode;
    DWORD dwDialExtraPercent;
    DWORD dwDialExtraSampleSeconds;
    DWORD dwHangUpExtraPercent;
    DWORD dwHangUpExtraSampleSeconds;
    DWORD dwIdleDisconnectSeconds;
    DWORD dwType;
    MPR_ET dwEncryptionType;
    DWORD dwCustomAuthKey;
    DWORD dwCustomAuthDataSize;
    BYTE* lpbCustomAuthData;
    GUID guidId;
    MPR_VS dwVpnStrategy;
} MPR_INTERFACE_2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MPR_INTERFACE_2
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string wszInterfaceName;
    public IntPtr hInterface;
    [MarshalAs(UnmanagedType.Bool)] public bool fEnabled;
    public int dwIfType;
    public int dwConnectionState;
    public uint fUnReachabilityReasons;
    public uint dwLastError;
    public uint dwfOptions;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] public string szLocalPhoneNumber;
    public IntPtr szAlternates;
    public uint ipaddr;
    public uint ipaddrDns;
    public uint ipaddrDnsAlt;
    public uint ipaddrWins;
    public uint ipaddrWinsAlt;
    public uint dwfNetProtocols;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 17)] public string szDeviceType;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] public string szDeviceName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)] public string szX25PadType;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 201)] public string szX25Address;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 201)] public string szX25Facilities;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 201)] public string szX25UserData;
    public uint dwChannels;
    public uint dwSubEntries;
    public uint dwDialMode;
    public uint dwDialExtraPercent;
    public uint dwDialExtraSampleSeconds;
    public uint dwHangUpExtraPercent;
    public uint dwHangUpExtraSampleSeconds;
    public uint dwIdleDisconnectSeconds;
    public uint dwType;
    public uint dwEncryptionType;
    public uint dwCustomAuthKey;
    public uint dwCustomAuthDataSize;
    public IntPtr lpbCustomAuthData;
    public Guid guidId;
    public uint dwVpnStrategy;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MPR_INTERFACE_2
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public wszInterfaceName As String
    Public hInterface As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public fEnabled As Boolean
    Public dwIfType As Integer
    Public dwConnectionState As Integer
    Public fUnReachabilityReasons As UInteger
    Public dwLastError As UInteger
    Public dwfOptions As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=129)> Public szLocalPhoneNumber As String
    Public szAlternates As IntPtr
    Public ipaddr As UInteger
    Public ipaddrDns As UInteger
    Public ipaddrDnsAlt As UInteger
    Public ipaddrWins As UInteger
    Public ipaddrWinsAlt As UInteger
    Public dwfNetProtocols As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=17)> Public szDeviceType As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=129)> Public szDeviceName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=33)> Public szX25PadType As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=201)> Public szX25Address As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=201)> Public szX25Facilities As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=201)> Public szX25UserData As String
    Public dwChannels As UInteger
    Public dwSubEntries As UInteger
    Public dwDialMode As UInteger
    Public dwDialExtraPercent As UInteger
    Public dwDialExtraSampleSeconds As UInteger
    Public dwHangUpExtraPercent As UInteger
    Public dwHangUpExtraSampleSeconds As UInteger
    Public dwIdleDisconnectSeconds As UInteger
    Public dwType As UInteger
    Public dwEncryptionType As UInteger
    Public dwCustomAuthKey As UInteger
    Public dwCustomAuthDataSize As UInteger
    Public lpbCustomAuthData As IntPtr
    Public guidId As Guid
    Public dwVpnStrategy As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MPR_INTERFACE_2(ctypes.Structure):
    _fields_ = [
        ("wszInterfaceName", ctypes.c_wchar * 257),
        ("hInterface", ctypes.c_void_p),
        ("fEnabled", wintypes.BOOL),
        ("dwIfType", ctypes.c_int),
        ("dwConnectionState", ctypes.c_int),
        ("fUnReachabilityReasons", wintypes.DWORD),
        ("dwLastError", wintypes.DWORD),
        ("dwfOptions", wintypes.DWORD),
        ("szLocalPhoneNumber", ctypes.c_wchar * 129),
        ("szAlternates", ctypes.c_void_p),
        ("ipaddr", wintypes.DWORD),
        ("ipaddrDns", wintypes.DWORD),
        ("ipaddrDnsAlt", wintypes.DWORD),
        ("ipaddrWins", wintypes.DWORD),
        ("ipaddrWinsAlt", wintypes.DWORD),
        ("dwfNetProtocols", wintypes.DWORD),
        ("szDeviceType", ctypes.c_wchar * 17),
        ("szDeviceName", ctypes.c_wchar * 129),
        ("szX25PadType", ctypes.c_wchar * 33),
        ("szX25Address", ctypes.c_wchar * 201),
        ("szX25Facilities", ctypes.c_wchar * 201),
        ("szX25UserData", ctypes.c_wchar * 201),
        ("dwChannels", wintypes.DWORD),
        ("dwSubEntries", wintypes.DWORD),
        ("dwDialMode", wintypes.DWORD),
        ("dwDialExtraPercent", wintypes.DWORD),
        ("dwDialExtraSampleSeconds", wintypes.DWORD),
        ("dwHangUpExtraPercent", wintypes.DWORD),
        ("dwHangUpExtraSampleSeconds", wintypes.DWORD),
        ("dwIdleDisconnectSeconds", wintypes.DWORD),
        ("dwType", wintypes.DWORD),
        ("dwEncryptionType", wintypes.DWORD),
        ("dwCustomAuthKey", wintypes.DWORD),
        ("dwCustomAuthDataSize", wintypes.DWORD),
        ("lpbCustomAuthData", ctypes.c_void_p),
        ("guidId", GUID),
        ("dwVpnStrategy", wintypes.DWORD),
    ]
#[repr(C)]
pub struct MPR_INTERFACE_2 {
    pub wszInterfaceName: [u16; 257],
    pub hInterface: *mut core::ffi::c_void,
    pub fEnabled: i32,
    pub dwIfType: i32,
    pub dwConnectionState: i32,
    pub fUnReachabilityReasons: u32,
    pub dwLastError: u32,
    pub dwfOptions: u32,
    pub szLocalPhoneNumber: [u16; 129],
    pub szAlternates: *mut core::ffi::c_void,
    pub ipaddr: u32,
    pub ipaddrDns: u32,
    pub ipaddrDnsAlt: u32,
    pub ipaddrWins: u32,
    pub ipaddrWinsAlt: u32,
    pub dwfNetProtocols: u32,
    pub szDeviceType: [u16; 17],
    pub szDeviceName: [u16; 129],
    pub szX25PadType: [u16; 33],
    pub szX25Address: [u16; 201],
    pub szX25Facilities: [u16; 201],
    pub szX25UserData: [u16; 201],
    pub dwChannels: u32,
    pub dwSubEntries: u32,
    pub dwDialMode: u32,
    pub dwDialExtraPercent: u32,
    pub dwDialExtraSampleSeconds: u32,
    pub dwHangUpExtraPercent: u32,
    pub dwHangUpExtraSampleSeconds: u32,
    pub dwIdleDisconnectSeconds: u32,
    pub dwType: u32,
    pub dwEncryptionType: u32,
    pub dwCustomAuthKey: u32,
    pub dwCustomAuthDataSize: u32,
    pub lpbCustomAuthData: *mut core::ffi::c_void,
    pub guidId: GUID,
    pub dwVpnStrategy: u32,
}
import "golang.org/x/sys/windows"

type MPR_INTERFACE_2 struct {
	wszInterfaceName [257]uint16
	hInterface uintptr
	fEnabled int32
	dwIfType int32
	dwConnectionState int32
	fUnReachabilityReasons uint32
	dwLastError uint32
	dwfOptions uint32
	szLocalPhoneNumber [129]uint16
	szAlternates uintptr
	ipaddr uint32
	ipaddrDns uint32
	ipaddrDnsAlt uint32
	ipaddrWins uint32
	ipaddrWinsAlt uint32
	dwfNetProtocols uint32
	szDeviceType [17]uint16
	szDeviceName [129]uint16
	szX25PadType [33]uint16
	szX25Address [201]uint16
	szX25Facilities [201]uint16
	szX25UserData [201]uint16
	dwChannels uint32
	dwSubEntries uint32
	dwDialMode uint32
	dwDialExtraPercent uint32
	dwDialExtraSampleSeconds uint32
	dwHangUpExtraPercent uint32
	dwHangUpExtraSampleSeconds uint32
	dwIdleDisconnectSeconds uint32
	dwType uint32
	dwEncryptionType uint32
	dwCustomAuthKey uint32
	dwCustomAuthDataSize uint32
	lpbCustomAuthData uintptr
	guidId windows.GUID
	dwVpnStrategy uint32
}
type
  MPR_INTERFACE_2 = record
    wszInterfaceName: array[0..256] of WideChar;
    hInterface: Pointer;
    fEnabled: BOOL;
    dwIfType: Integer;
    dwConnectionState: Integer;
    fUnReachabilityReasons: DWORD;
    dwLastError: DWORD;
    dwfOptions: DWORD;
    szLocalPhoneNumber: array[0..128] of WideChar;
    szAlternates: Pointer;
    ipaddr: DWORD;
    ipaddrDns: DWORD;
    ipaddrDnsAlt: DWORD;
    ipaddrWins: DWORD;
    ipaddrWinsAlt: DWORD;
    dwfNetProtocols: DWORD;
    szDeviceType: array[0..16] of WideChar;
    szDeviceName: array[0..128] of WideChar;
    szX25PadType: array[0..32] of WideChar;
    szX25Address: array[0..200] of WideChar;
    szX25Facilities: array[0..200] of WideChar;
    szX25UserData: array[0..200] of WideChar;
    dwChannels: DWORD;
    dwSubEntries: DWORD;
    dwDialMode: DWORD;
    dwDialExtraPercent: DWORD;
    dwDialExtraSampleSeconds: DWORD;
    dwHangUpExtraPercent: DWORD;
    dwHangUpExtraSampleSeconds: DWORD;
    dwIdleDisconnectSeconds: DWORD;
    dwType: DWORD;
    dwEncryptionType: DWORD;
    dwCustomAuthKey: DWORD;
    dwCustomAuthDataSize: DWORD;
    lpbCustomAuthData: Pointer;
    guidId: TGUID;
    dwVpnStrategy: DWORD;
  end;
const MPR_INTERFACE_2 = extern struct {
    wszInterfaceName: [257]u16,
    hInterface: ?*anyopaque,
    fEnabled: i32,
    dwIfType: i32,
    dwConnectionState: i32,
    fUnReachabilityReasons: u32,
    dwLastError: u32,
    dwfOptions: u32,
    szLocalPhoneNumber: [129]u16,
    szAlternates: ?*anyopaque,
    ipaddr: u32,
    ipaddrDns: u32,
    ipaddrDnsAlt: u32,
    ipaddrWins: u32,
    ipaddrWinsAlt: u32,
    dwfNetProtocols: u32,
    szDeviceType: [17]u16,
    szDeviceName: [129]u16,
    szX25PadType: [33]u16,
    szX25Address: [201]u16,
    szX25Facilities: [201]u16,
    szX25UserData: [201]u16,
    dwChannels: u32,
    dwSubEntries: u32,
    dwDialMode: u32,
    dwDialExtraPercent: u32,
    dwDialExtraSampleSeconds: u32,
    dwHangUpExtraPercent: u32,
    dwHangUpExtraSampleSeconds: u32,
    dwIdleDisconnectSeconds: u32,
    dwType: u32,
    dwEncryptionType: u32,
    dwCustomAuthKey: u32,
    dwCustomAuthDataSize: u32,
    lpbCustomAuthData: ?*anyopaque,
    guidId: GUID,
    dwVpnStrategy: u32,
};
type
  MPR_INTERFACE_2 {.bycopy.} = object
    wszInterfaceName: array[257, uint16]
    hInterface: pointer
    fEnabled: int32
    dwIfType: int32
    dwConnectionState: int32
    fUnReachabilityReasons: uint32
    dwLastError: uint32
    dwfOptions: uint32
    szLocalPhoneNumber: array[129, uint16]
    szAlternates: pointer
    ipaddr: uint32
    ipaddrDns: uint32
    ipaddrDnsAlt: uint32
    ipaddrWins: uint32
    ipaddrWinsAlt: uint32
    dwfNetProtocols: uint32
    szDeviceType: array[17, uint16]
    szDeviceName: array[129, uint16]
    szX25PadType: array[33, uint16]
    szX25Address: array[201, uint16]
    szX25Facilities: array[201, uint16]
    szX25UserData: array[201, uint16]
    dwChannels: uint32
    dwSubEntries: uint32
    dwDialMode: uint32
    dwDialExtraPercent: uint32
    dwDialExtraSampleSeconds: uint32
    dwHangUpExtraPercent: uint32
    dwHangUpExtraSampleSeconds: uint32
    dwIdleDisconnectSeconds: uint32
    dwType: uint32
    dwEncryptionType: uint32
    dwCustomAuthKey: uint32
    dwCustomAuthDataSize: uint32
    lpbCustomAuthData: pointer
    guidId: GUID
    dwVpnStrategy: uint32
struct MPR_INTERFACE_2
{
    wchar[257] wszInterfaceName;
    void* hInterface;
    int fEnabled;
    int dwIfType;
    int dwConnectionState;
    uint fUnReachabilityReasons;
    uint dwLastError;
    uint dwfOptions;
    wchar[129] szLocalPhoneNumber;
    void* szAlternates;
    uint ipaddr;
    uint ipaddrDns;
    uint ipaddrDnsAlt;
    uint ipaddrWins;
    uint ipaddrWinsAlt;
    uint dwfNetProtocols;
    wchar[17] szDeviceType;
    wchar[129] szDeviceName;
    wchar[33] szX25PadType;
    wchar[201] szX25Address;
    wchar[201] szX25Facilities;
    wchar[201] szX25UserData;
    uint dwChannels;
    uint dwSubEntries;
    uint dwDialMode;
    uint dwDialExtraPercent;
    uint dwDialExtraSampleSeconds;
    uint dwHangUpExtraPercent;
    uint dwHangUpExtraSampleSeconds;
    uint dwIdleDisconnectSeconds;
    uint dwType;
    uint dwEncryptionType;
    uint dwCustomAuthKey;
    uint dwCustomAuthDataSize;
    void* lpbCustomAuthData;
    GUID guidId;
    uint dwVpnStrategy;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MPR_INTERFACE_2 サイズ: 2468 バイト(x86)
dim st, 617    ; 4byte整数×617(構造体サイズ 2468 / 4 切り上げ)
; wszInterfaceName : WCHAR (+0, 514byte)  varptr(st)+0 を基点に操作(514byte:入れ子/配列)
; hInterface : HANDLE (+516, 4byte)  st.129 = 値  /  値 = st.129   (lpoke/lpeek も可)
; fEnabled : BOOL (+520, 4byte)  st.130 = 値  /  値 = st.130   (lpoke/lpeek も可)
; dwIfType : ROUTER_INTERFACE_TYPE (+524, 4byte)  st.131 = 値  /  値 = st.131   (lpoke/lpeek も可)
; dwConnectionState : ROUTER_CONNECTION_STATE (+528, 4byte)  st.132 = 値  /  値 = st.132   (lpoke/lpeek も可)
; fUnReachabilityReasons : DWORD (+532, 4byte)  st.133 = 値  /  値 = st.133   (lpoke/lpeek も可)
; dwLastError : DWORD (+536, 4byte)  st.134 = 値  /  値 = st.134   (lpoke/lpeek も可)
; dwfOptions : DWORD (+540, 4byte)  st.135 = 値  /  値 = st.135   (lpoke/lpeek も可)
; szLocalPhoneNumber : WCHAR (+544, 258byte)  varptr(st)+544 を基点に操作(258byte:入れ子/配列)
; szAlternates : LPWSTR (+804, 4byte)  st.201 = 値  /  値 = st.201   (lpoke/lpeek も可)
; ipaddr : DWORD (+808, 4byte)  st.202 = 値  /  値 = st.202   (lpoke/lpeek も可)
; ipaddrDns : DWORD (+812, 4byte)  st.203 = 値  /  値 = st.203   (lpoke/lpeek も可)
; ipaddrDnsAlt : DWORD (+816, 4byte)  st.204 = 値  /  値 = st.204   (lpoke/lpeek も可)
; ipaddrWins : DWORD (+820, 4byte)  st.205 = 値  /  値 = st.205   (lpoke/lpeek も可)
; ipaddrWinsAlt : DWORD (+824, 4byte)  st.206 = 値  /  値 = st.206   (lpoke/lpeek も可)
; dwfNetProtocols : DWORD (+828, 4byte)  st.207 = 値  /  値 = st.207   (lpoke/lpeek も可)
; szDeviceType : WCHAR (+832, 34byte)  varptr(st)+832 を基点に操作(34byte:入れ子/配列)
; szDeviceName : WCHAR (+866, 258byte)  varptr(st)+866 を基点に操作(258byte:入れ子/配列)
; szX25PadType : WCHAR (+1124, 66byte)  varptr(st)+1124 を基点に操作(66byte:入れ子/配列)
; szX25Address : WCHAR (+1190, 402byte)  varptr(st)+1190 を基点に操作(402byte:入れ子/配列)
; szX25Facilities : WCHAR (+1592, 402byte)  varptr(st)+1592 を基点に操作(402byte:入れ子/配列)
; szX25UserData : WCHAR (+1994, 402byte)  varptr(st)+1994 を基点に操作(402byte:入れ子/配列)
; dwChannels : DWORD (+2396, 4byte)  st.599 = 値  /  値 = st.599   (lpoke/lpeek も可)
; dwSubEntries : DWORD (+2400, 4byte)  st.600 = 値  /  値 = st.600   (lpoke/lpeek も可)
; dwDialMode : MPR_INTERFACE_DIAL_MODE (+2404, 4byte)  st.601 = 値  /  値 = st.601   (lpoke/lpeek も可)
; dwDialExtraPercent : DWORD (+2408, 4byte)  st.602 = 値  /  値 = st.602   (lpoke/lpeek も可)
; dwDialExtraSampleSeconds : DWORD (+2412, 4byte)  st.603 = 値  /  値 = st.603   (lpoke/lpeek も可)
; dwHangUpExtraPercent : DWORD (+2416, 4byte)  st.604 = 値  /  値 = st.604   (lpoke/lpeek も可)
; dwHangUpExtraSampleSeconds : DWORD (+2420, 4byte)  st.605 = 値  /  値 = st.605   (lpoke/lpeek も可)
; dwIdleDisconnectSeconds : DWORD (+2424, 4byte)  st.606 = 値  /  値 = st.606   (lpoke/lpeek も可)
; dwType : DWORD (+2428, 4byte)  st.607 = 値  /  値 = st.607   (lpoke/lpeek も可)
; dwEncryptionType : MPR_ET (+2432, 4byte)  st.608 = 値  /  値 = st.608   (lpoke/lpeek も可)
; dwCustomAuthKey : DWORD (+2436, 4byte)  st.609 = 値  /  値 = st.609   (lpoke/lpeek も可)
; dwCustomAuthDataSize : DWORD (+2440, 4byte)  st.610 = 値  /  値 = st.610   (lpoke/lpeek も可)
; lpbCustomAuthData : BYTE* (+2444, 4byte)  st.611 = 値  /  値 = st.611   (lpoke/lpeek も可)
; guidId : GUID (+2448, 16byte)  varptr(st)+2448 を基点に操作(16byte:入れ子/配列)
; dwVpnStrategy : MPR_VS (+2464, 4byte)  st.616 = 値  /  値 = st.616   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MPR_INTERFACE_2 サイズ: 2496 バイト(x64)
dim st, 624    ; 4byte整数×624(構造体サイズ 2496 / 4 切り上げ)
; wszInterfaceName : WCHAR (+0, 514byte)  varptr(st)+0 を基点に操作(514byte:入れ子/配列)
; hInterface : HANDLE (+520, 8byte)  qpoke st,520,値 / qpeek(st,520)  ※IronHSPのみ。3.7/3.8は lpoke st,520,下位 : lpoke st,524,上位
; fEnabled : BOOL (+528, 4byte)  st.132 = 値  /  値 = st.132   (lpoke/lpeek も可)
; dwIfType : ROUTER_INTERFACE_TYPE (+532, 4byte)  st.133 = 値  /  値 = st.133   (lpoke/lpeek も可)
; dwConnectionState : ROUTER_CONNECTION_STATE (+536, 4byte)  st.134 = 値  /  値 = st.134   (lpoke/lpeek も可)
; fUnReachabilityReasons : DWORD (+540, 4byte)  st.135 = 値  /  値 = st.135   (lpoke/lpeek も可)
; dwLastError : DWORD (+544, 4byte)  st.136 = 値  /  値 = st.136   (lpoke/lpeek も可)
; dwfOptions : DWORD (+548, 4byte)  st.137 = 値  /  値 = st.137   (lpoke/lpeek も可)
; szLocalPhoneNumber : WCHAR (+552, 258byte)  varptr(st)+552 を基点に操作(258byte:入れ子/配列)
; szAlternates : LPWSTR (+816, 8byte)  qpoke st,816,値 / qpeek(st,816)  ※IronHSPのみ。3.7/3.8は lpoke st,816,下位 : lpoke st,820,上位
; ipaddr : DWORD (+824, 4byte)  st.206 = 値  /  値 = st.206   (lpoke/lpeek も可)
; ipaddrDns : DWORD (+828, 4byte)  st.207 = 値  /  値 = st.207   (lpoke/lpeek も可)
; ipaddrDnsAlt : DWORD (+832, 4byte)  st.208 = 値  /  値 = st.208   (lpoke/lpeek も可)
; ipaddrWins : DWORD (+836, 4byte)  st.209 = 値  /  値 = st.209   (lpoke/lpeek も可)
; ipaddrWinsAlt : DWORD (+840, 4byte)  st.210 = 値  /  値 = st.210   (lpoke/lpeek も可)
; dwfNetProtocols : DWORD (+844, 4byte)  st.211 = 値  /  値 = st.211   (lpoke/lpeek も可)
; szDeviceType : WCHAR (+848, 34byte)  varptr(st)+848 を基点に操作(34byte:入れ子/配列)
; szDeviceName : WCHAR (+882, 258byte)  varptr(st)+882 を基点に操作(258byte:入れ子/配列)
; szX25PadType : WCHAR (+1140, 66byte)  varptr(st)+1140 を基点に操作(66byte:入れ子/配列)
; szX25Address : WCHAR (+1206, 402byte)  varptr(st)+1206 を基点に操作(402byte:入れ子/配列)
; szX25Facilities : WCHAR (+1608, 402byte)  varptr(st)+1608 を基点に操作(402byte:入れ子/配列)
; szX25UserData : WCHAR (+2010, 402byte)  varptr(st)+2010 を基点に操作(402byte:入れ子/配列)
; dwChannels : DWORD (+2412, 4byte)  st.603 = 値  /  値 = st.603   (lpoke/lpeek も可)
; dwSubEntries : DWORD (+2416, 4byte)  st.604 = 値  /  値 = st.604   (lpoke/lpeek も可)
; dwDialMode : MPR_INTERFACE_DIAL_MODE (+2420, 4byte)  st.605 = 値  /  値 = st.605   (lpoke/lpeek も可)
; dwDialExtraPercent : DWORD (+2424, 4byte)  st.606 = 値  /  値 = st.606   (lpoke/lpeek も可)
; dwDialExtraSampleSeconds : DWORD (+2428, 4byte)  st.607 = 値  /  値 = st.607   (lpoke/lpeek も可)
; dwHangUpExtraPercent : DWORD (+2432, 4byte)  st.608 = 値  /  値 = st.608   (lpoke/lpeek も可)
; dwHangUpExtraSampleSeconds : DWORD (+2436, 4byte)  st.609 = 値  /  値 = st.609   (lpoke/lpeek も可)
; dwIdleDisconnectSeconds : DWORD (+2440, 4byte)  st.610 = 値  /  値 = st.610   (lpoke/lpeek も可)
; dwType : DWORD (+2444, 4byte)  st.611 = 値  /  値 = st.611   (lpoke/lpeek も可)
; dwEncryptionType : MPR_ET (+2448, 4byte)  st.612 = 値  /  値 = st.612   (lpoke/lpeek も可)
; dwCustomAuthKey : DWORD (+2452, 4byte)  st.613 = 値  /  値 = st.613   (lpoke/lpeek も可)
; dwCustomAuthDataSize : DWORD (+2456, 4byte)  st.614 = 値  /  値 = st.614   (lpoke/lpeek も可)
; lpbCustomAuthData : BYTE* (+2464, 8byte)  qpoke st,2464,値 / qpeek(st,2464)  ※IronHSPのみ。3.7/3.8は lpoke st,2464,下位 : lpoke st,2468,上位
; guidId : GUID (+2472, 16byte)  varptr(st)+2472 を基点に操作(16byte:入れ子/配列)
; dwVpnStrategy : MPR_VS (+2488, 4byte)  st.622 = 値  /  値 = st.622   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global MPR_INTERFACE_2
    #field wchar wszInterfaceName 257
    #field intptr hInterface
    #field bool fEnabled
    #field int dwIfType
    #field int dwConnectionState
    #field int fUnReachabilityReasons
    #field int dwLastError
    #field int dwfOptions
    #field wchar szLocalPhoneNumber 129
    #field intptr szAlternates
    #field int ipaddr
    #field int ipaddrDns
    #field int ipaddrDnsAlt
    #field int ipaddrWins
    #field int ipaddrWinsAlt
    #field int dwfNetProtocols
    #field wchar szDeviceType 17
    #field wchar szDeviceName 129
    #field wchar szX25PadType 33
    #field wchar szX25Address 201
    #field wchar szX25Facilities 201
    #field wchar szX25UserData 201
    #field int dwChannels
    #field int dwSubEntries
    #field int dwDialMode
    #field int dwDialExtraPercent
    #field int dwDialExtraSampleSeconds
    #field int dwHangUpExtraPercent
    #field int dwHangUpExtraSampleSeconds
    #field int dwIdleDisconnectSeconds
    #field int dwType
    #field int dwEncryptionType
    #field int dwCustomAuthKey
    #field int dwCustomAuthDataSize
    #field intptr lpbCustomAuthData
    #field GUID guidId
    #field int dwVpnStrategy
#endstruct

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