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

RAS_CONNECTION_EX

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

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

フィールド

フィールドサイズx64x86説明
HeaderMPRAPI_OBJECT_HEADER4+0+0オブジェクトのリビジョン・種別・サイズを示すMPRAPI_OBJECT_HEADER。
dwConnectDurationDWORD4+4+4接続が確立してからの経過時間(ミリ秒)。
dwInterfaceTypeROUTER_INTERFACE_TYPE4+8+8インターフェイスの種別を表すROUTER_INTERFACE_TYPE列挙値。
dwConnectionFlagsRAS_FLAGS4+12+12接続の属性を示すRAS_FLAGS列挙値。
wszInterfaceNameWCHAR514+16+16接続に関連付くインターフェイスの名前(ワイド文字列)。
wszUserNameWCHAR514+530+530接続したユーザーの名前(ワイド文字列)。
wszLogonDomainWCHAR32+1044+1044ユーザーがログオンしたドメイン名(ワイド文字列)。
wszRemoteComputerWCHAR34+1076+1076リモートコンピューターの名前(ワイド文字列)。
guidGUID16+1112+1112接続を一意に識別するGUID。
rasQuarStateRAS_QUARANTINE_STATE4+1128+1128ネットワーク検疫の状態を表すRAS_QUARANTINE_STATE列挙値。
probationTimeFILETIME8+1132+1132検疫の試用期間終了時刻を表すFILETIME。
dwBytesXmitedDWORD4+1140+1140送信されたバイト数。
dwBytesRcvedDWORD4+1144+1144受信したバイト数。
dwFramesXmitedDWORD4+1148+1148送信されたフレーム数。
dwFramesRcvedDWORD4+1152+1152受信したフレーム数。
dwCrcErrDWORD4+1156+1156発生したCRCエラーの数。
dwTimeoutErrDWORD4+1160+1160発生したタイムアウトエラーの数。
dwAlignmentErrDWORD4+1164+1164発生したアラインメントエラーの数。
dwHardwareOverrunErrDWORD4+1168+1168発生したハードウェアオーバーランエラーの数。
dwFramingErrDWORD4+1172+1172発生したフレーミングエラーの数。
dwBufferOverrunErrDWORD4+1176+1176発生したバッファオーバーランエラーの数。
dwCompressionRatioInDWORD4+1180+1180受信データの圧縮率(%)。
dwCompressionRatioOutDWORD4+1184+1184送信データの圧縮率(%)。
dwNumSwitchOversDWORD4+1188+1188接続が別エンドポイントへ切り替わった回数。
wszRemoteEndpointAddressWCHAR130+1192+1192リモート側VPNエンドポイントのアドレス(ワイド文字列)。
wszLocalEndpointAddressWCHAR130+1322+1322ローカル側VPNエンドポイントのアドレス(ワイド文字列)。
ProjectionInfoPROJECTION_INFO200+1456+1456接続のプロジェクション情報(PROJECTION_INFO)。
hConnectionHANDLE8/4+1656+1656接続を識別するハンドル。
hInterfaceHANDLE8/4+1664+1660接続に関連付くインターフェイスのハンドル。

各言語での定義

#include <windows.h>

// MPRAPI_OBJECT_HEADER  (x64 4 / x86 4 バイト)
typedef struct MPRAPI_OBJECT_HEADER {
    BYTE revision;
    BYTE type;
    WORD size;
} MPRAPI_OBJECT_HEADER;

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// PROJECTION_INFO  (x64 200 / x86 200 バイト)
typedef struct PROJECTION_INFO {
    BYTE projectionInfoType;
    _Anonymous_e__Union Anonymous;
} PROJECTION_INFO;

// RAS_CONNECTION_EX  (x64 1672 / x86 1664 バイト)
typedef struct RAS_CONNECTION_EX {
    MPRAPI_OBJECT_HEADER Header;
    DWORD dwConnectDuration;
    ROUTER_INTERFACE_TYPE dwInterfaceType;
    RAS_FLAGS dwConnectionFlags;
    WCHAR wszInterfaceName[257];
    WCHAR wszUserName[257];
    WCHAR wszLogonDomain[16];
    WCHAR wszRemoteComputer[17];
    GUID guid;
    RAS_QUARANTINE_STATE rasQuarState;
    FILETIME probationTime;
    DWORD dwBytesXmited;
    DWORD dwBytesRcved;
    DWORD dwFramesXmited;
    DWORD dwFramesRcved;
    DWORD dwCrcErr;
    DWORD dwTimeoutErr;
    DWORD dwAlignmentErr;
    DWORD dwHardwareOverrunErr;
    DWORD dwFramingErr;
    DWORD dwBufferOverrunErr;
    DWORD dwCompressionRatioIn;
    DWORD dwCompressionRatioOut;
    DWORD dwNumSwitchOvers;
    WCHAR wszRemoteEndpointAddress[65];
    WCHAR wszLocalEndpointAddress[65];
    PROJECTION_INFO ProjectionInfo;
    HANDLE hConnection;
    HANDLE hInterface;
} RAS_CONNECTION_EX;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MPRAPI_OBJECT_HEADER
{
    public byte revision;
    public byte type;
    public ushort size;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
    public uint dwLowDateTime;
    public uint dwHighDateTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PROJECTION_INFO
{
    public byte projectionInfoType;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RAS_CONNECTION_EX
{
    public MPRAPI_OBJECT_HEADER Header;
    public uint dwConnectDuration;
    public int dwInterfaceType;
    public uint dwConnectionFlags;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string wszInterfaceName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string wszUserName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string wszLogonDomain;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 17)] public string wszRemoteComputer;
    public Guid guid;
    public int rasQuarState;
    public FILETIME probationTime;
    public uint dwBytesXmited;
    public uint dwBytesRcved;
    public uint dwFramesXmited;
    public uint dwFramesRcved;
    public uint dwCrcErr;
    public uint dwTimeoutErr;
    public uint dwAlignmentErr;
    public uint dwHardwareOverrunErr;
    public uint dwFramingErr;
    public uint dwBufferOverrunErr;
    public uint dwCompressionRatioIn;
    public uint dwCompressionRatioOut;
    public uint dwNumSwitchOvers;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)] public string wszRemoteEndpointAddress;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 65)] public string wszLocalEndpointAddress;
    public PROJECTION_INFO ProjectionInfo;
    public IntPtr hConnection;
    public IntPtr hInterface;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MPRAPI_OBJECT_HEADER
    Public revision As Byte
    Public type As Byte
    Public size As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
    Public dwLowDateTime As UInteger
    Public dwHighDateTime As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PROJECTION_INFO
    Public projectionInfoType As Byte
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RAS_CONNECTION_EX
    Public Header As MPRAPI_OBJECT_HEADER
    Public dwConnectDuration As UInteger
    Public dwInterfaceType As Integer
    Public dwConnectionFlags As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public wszInterfaceName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public wszUserName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public wszLogonDomain As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=17)> Public wszRemoteComputer As String
    Public guid As Guid
    Public rasQuarState As Integer
    Public probationTime As FILETIME
    Public dwBytesXmited As UInteger
    Public dwBytesRcved As UInteger
    Public dwFramesXmited As UInteger
    Public dwFramesRcved As UInteger
    Public dwCrcErr As UInteger
    Public dwTimeoutErr As UInteger
    Public dwAlignmentErr As UInteger
    Public dwHardwareOverrunErr As UInteger
    Public dwFramingErr As UInteger
    Public dwBufferOverrunErr As UInteger
    Public dwCompressionRatioIn As UInteger
    Public dwCompressionRatioOut As UInteger
    Public dwNumSwitchOvers As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=65)> Public wszRemoteEndpointAddress As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=65)> Public wszLocalEndpointAddress As String
    Public ProjectionInfo As PROJECTION_INFO
    Public hConnection As IntPtr
    Public hInterface As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class MPRAPI_OBJECT_HEADER(ctypes.Structure):
    _fields_ = [
        ("revision", ctypes.c_ubyte),
        ("type", ctypes.c_ubyte),
        ("size", ctypes.c_ushort),
    ]

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class PROJECTION_INFO(ctypes.Structure):
    _fields_ = [
        ("projectionInfoType", ctypes.c_ubyte),
        ("Anonymous", _Anonymous_e__Union),
    ]

class RAS_CONNECTION_EX(ctypes.Structure):
    _fields_ = [
        ("Header", MPRAPI_OBJECT_HEADER),
        ("dwConnectDuration", wintypes.DWORD),
        ("dwInterfaceType", ctypes.c_int),
        ("dwConnectionFlags", wintypes.DWORD),
        ("wszInterfaceName", ctypes.c_wchar * 257),
        ("wszUserName", ctypes.c_wchar * 257),
        ("wszLogonDomain", ctypes.c_wchar * 16),
        ("wszRemoteComputer", ctypes.c_wchar * 17),
        ("guid", GUID),
        ("rasQuarState", ctypes.c_int),
        ("probationTime", FILETIME),
        ("dwBytesXmited", wintypes.DWORD),
        ("dwBytesRcved", wintypes.DWORD),
        ("dwFramesXmited", wintypes.DWORD),
        ("dwFramesRcved", wintypes.DWORD),
        ("dwCrcErr", wintypes.DWORD),
        ("dwTimeoutErr", wintypes.DWORD),
        ("dwAlignmentErr", wintypes.DWORD),
        ("dwHardwareOverrunErr", wintypes.DWORD),
        ("dwFramingErr", wintypes.DWORD),
        ("dwBufferOverrunErr", wintypes.DWORD),
        ("dwCompressionRatioIn", wintypes.DWORD),
        ("dwCompressionRatioOut", wintypes.DWORD),
        ("dwNumSwitchOvers", wintypes.DWORD),
        ("wszRemoteEndpointAddress", ctypes.c_wchar * 65),
        ("wszLocalEndpointAddress", ctypes.c_wchar * 65),
        ("ProjectionInfo", PROJECTION_INFO),
        ("hConnection", ctypes.c_void_p),
        ("hInterface", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct MPRAPI_OBJECT_HEADER {
    pub revision: u8,
    pub type: u8,
    pub size: u16,
}

#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

#[repr(C)]
pub struct PROJECTION_INFO {
    pub projectionInfoType: u8,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct RAS_CONNECTION_EX {
    pub Header: MPRAPI_OBJECT_HEADER,
    pub dwConnectDuration: u32,
    pub dwInterfaceType: i32,
    pub dwConnectionFlags: u32,
    pub wszInterfaceName: [u16; 257],
    pub wszUserName: [u16; 257],
    pub wszLogonDomain: [u16; 16],
    pub wszRemoteComputer: [u16; 17],
    pub guid: GUID,
    pub rasQuarState: i32,
    pub probationTime: FILETIME,
    pub dwBytesXmited: u32,
    pub dwBytesRcved: u32,
    pub dwFramesXmited: u32,
    pub dwFramesRcved: u32,
    pub dwCrcErr: u32,
    pub dwTimeoutErr: u32,
    pub dwAlignmentErr: u32,
    pub dwHardwareOverrunErr: u32,
    pub dwFramingErr: u32,
    pub dwBufferOverrunErr: u32,
    pub dwCompressionRatioIn: u32,
    pub dwCompressionRatioOut: u32,
    pub dwNumSwitchOvers: u32,
    pub wszRemoteEndpointAddress: [u16; 65],
    pub wszLocalEndpointAddress: [u16; 65],
    pub ProjectionInfo: PROJECTION_INFO,
    pub hConnection: *mut core::ffi::c_void,
    pub hInterface: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type MPRAPI_OBJECT_HEADER struct {
	revision byte
	type byte
	size uint16
}

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type PROJECTION_INFO struct {
	projectionInfoType byte
	Anonymous _Anonymous_e__Union
}

type RAS_CONNECTION_EX struct {
	Header MPRAPI_OBJECT_HEADER
	dwConnectDuration uint32
	dwInterfaceType int32
	dwConnectionFlags uint32
	wszInterfaceName [257]uint16
	wszUserName [257]uint16
	wszLogonDomain [16]uint16
	wszRemoteComputer [17]uint16
	guid windows.GUID
	rasQuarState int32
	probationTime FILETIME
	dwBytesXmited uint32
	dwBytesRcved uint32
	dwFramesXmited uint32
	dwFramesRcved uint32
	dwCrcErr uint32
	dwTimeoutErr uint32
	dwAlignmentErr uint32
	dwHardwareOverrunErr uint32
	dwFramingErr uint32
	dwBufferOverrunErr uint32
	dwCompressionRatioIn uint32
	dwCompressionRatioOut uint32
	dwNumSwitchOvers uint32
	wszRemoteEndpointAddress [65]uint16
	wszLocalEndpointAddress [65]uint16
	ProjectionInfo PROJECTION_INFO
	hConnection uintptr
	hInterface uintptr
}
type
  MPRAPI_OBJECT_HEADER = record
    revision: Byte;
    type: Byte;
    size: Word;
  end;

  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  PROJECTION_INFO = record
    projectionInfoType: Byte;
    Anonymous: _Anonymous_e__Union;
  end;

  RAS_CONNECTION_EX = record
    Header: MPRAPI_OBJECT_HEADER;
    dwConnectDuration: DWORD;
    dwInterfaceType: Integer;
    dwConnectionFlags: DWORD;
    wszInterfaceName: array[0..256] of WideChar;
    wszUserName: array[0..256] of WideChar;
    wszLogonDomain: array[0..15] of WideChar;
    wszRemoteComputer: array[0..16] of WideChar;
    guid: TGUID;
    rasQuarState: Integer;
    probationTime: FILETIME;
    dwBytesXmited: DWORD;
    dwBytesRcved: DWORD;
    dwFramesXmited: DWORD;
    dwFramesRcved: DWORD;
    dwCrcErr: DWORD;
    dwTimeoutErr: DWORD;
    dwAlignmentErr: DWORD;
    dwHardwareOverrunErr: DWORD;
    dwFramingErr: DWORD;
    dwBufferOverrunErr: DWORD;
    dwCompressionRatioIn: DWORD;
    dwCompressionRatioOut: DWORD;
    dwNumSwitchOvers: DWORD;
    wszRemoteEndpointAddress: array[0..64] of WideChar;
    wszLocalEndpointAddress: array[0..64] of WideChar;
    ProjectionInfo: PROJECTION_INFO;
    hConnection: Pointer;
    hInterface: Pointer;
  end;
const MPRAPI_OBJECT_HEADER = extern struct {
    revision: u8,
    type: u8,
    size: u16,
};

const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const PROJECTION_INFO = extern struct {
    projectionInfoType: u8,
    Anonymous: _Anonymous_e__Union,
};

const RAS_CONNECTION_EX = extern struct {
    Header: MPRAPI_OBJECT_HEADER,
    dwConnectDuration: u32,
    dwInterfaceType: i32,
    dwConnectionFlags: u32,
    wszInterfaceName: [257]u16,
    wszUserName: [257]u16,
    wszLogonDomain: [16]u16,
    wszRemoteComputer: [17]u16,
    guid: GUID,
    rasQuarState: i32,
    probationTime: FILETIME,
    dwBytesXmited: u32,
    dwBytesRcved: u32,
    dwFramesXmited: u32,
    dwFramesRcved: u32,
    dwCrcErr: u32,
    dwTimeoutErr: u32,
    dwAlignmentErr: u32,
    dwHardwareOverrunErr: u32,
    dwFramingErr: u32,
    dwBufferOverrunErr: u32,
    dwCompressionRatioIn: u32,
    dwCompressionRatioOut: u32,
    dwNumSwitchOvers: u32,
    wszRemoteEndpointAddress: [65]u16,
    wszLocalEndpointAddress: [65]u16,
    ProjectionInfo: PROJECTION_INFO,
    hConnection: ?*anyopaque,
    hInterface: ?*anyopaque,
};
type
  MPRAPI_OBJECT_HEADER {.bycopy.} = object
    revision: uint8
    type: uint8
    size: uint16

  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  PROJECTION_INFO {.bycopy.} = object
    projectionInfoType: uint8
    Anonymous: _Anonymous_e__Union

  RAS_CONNECTION_EX {.bycopy.} = object
    Header: MPRAPI_OBJECT_HEADER
    dwConnectDuration: uint32
    dwInterfaceType: int32
    dwConnectionFlags: uint32
    wszInterfaceName: array[257, uint16]
    wszUserName: array[257, uint16]
    wszLogonDomain: array[16, uint16]
    wszRemoteComputer: array[17, uint16]
    guid: GUID
    rasQuarState: int32
    probationTime: FILETIME
    dwBytesXmited: uint32
    dwBytesRcved: uint32
    dwFramesXmited: uint32
    dwFramesRcved: uint32
    dwCrcErr: uint32
    dwTimeoutErr: uint32
    dwAlignmentErr: uint32
    dwHardwareOverrunErr: uint32
    dwFramingErr: uint32
    dwBufferOverrunErr: uint32
    dwCompressionRatioIn: uint32
    dwCompressionRatioOut: uint32
    dwNumSwitchOvers: uint32
    wszRemoteEndpointAddress: array[65, uint16]
    wszLocalEndpointAddress: array[65, uint16]
    ProjectionInfo: PROJECTION_INFO
    hConnection: pointer
    hInterface: pointer
struct MPRAPI_OBJECT_HEADER
{
    ubyte revision;
    ubyte type;
    ushort size;
}

struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct PROJECTION_INFO
{
    ubyte projectionInfoType;
    _Anonymous_e__Union Anonymous;
}

struct RAS_CONNECTION_EX
{
    MPRAPI_OBJECT_HEADER Header;
    uint dwConnectDuration;
    int dwInterfaceType;
    uint dwConnectionFlags;
    wchar[257] wszInterfaceName;
    wchar[257] wszUserName;
    wchar[16] wszLogonDomain;
    wchar[17] wszRemoteComputer;
    GUID guid;
    int rasQuarState;
    FILETIME probationTime;
    uint dwBytesXmited;
    uint dwBytesRcved;
    uint dwFramesXmited;
    uint dwFramesRcved;
    uint dwCrcErr;
    uint dwTimeoutErr;
    uint dwAlignmentErr;
    uint dwHardwareOverrunErr;
    uint dwFramingErr;
    uint dwBufferOverrunErr;
    uint dwCompressionRatioIn;
    uint dwCompressionRatioOut;
    uint dwNumSwitchOvers;
    wchar[65] wszRemoteEndpointAddress;
    wchar[65] wszLocalEndpointAddress;
    PROJECTION_INFO ProjectionInfo;
    void* hConnection;
    void* hInterface;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RAS_CONNECTION_EX サイズ: 1664 バイト(x86)
dim st, 416    ; 4byte整数×416(構造体サイズ 1664 / 4 切り上げ)
; Header : MPRAPI_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; dwConnectDuration : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwInterfaceType : ROUTER_INTERFACE_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwConnectionFlags : RAS_FLAGS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; wszInterfaceName : WCHAR (+16, 514byte)  varptr(st)+16 を基点に操作(514byte:入れ子/配列)
; wszUserName : WCHAR (+530, 514byte)  varptr(st)+530 を基点に操作(514byte:入れ子/配列)
; wszLogonDomain : WCHAR (+1044, 32byte)  varptr(st)+1044 を基点に操作(32byte:入れ子/配列)
; wszRemoteComputer : WCHAR (+1076, 34byte)  varptr(st)+1076 を基点に操作(34byte:入れ子/配列)
; guid : GUID (+1112, 16byte)  varptr(st)+1112 を基点に操作(16byte:入れ子/配列)
; rasQuarState : RAS_QUARANTINE_STATE (+1128, 4byte)  st.282 = 値  /  値 = st.282   (lpoke/lpeek も可)
; probationTime : FILETIME (+1132, 8byte)  varptr(st)+1132 を基点に操作(8byte:入れ子/配列)
; dwBytesXmited : DWORD (+1140, 4byte)  st.285 = 値  /  値 = st.285   (lpoke/lpeek も可)
; dwBytesRcved : DWORD (+1144, 4byte)  st.286 = 値  /  値 = st.286   (lpoke/lpeek も可)
; dwFramesXmited : DWORD (+1148, 4byte)  st.287 = 値  /  値 = st.287   (lpoke/lpeek も可)
; dwFramesRcved : DWORD (+1152, 4byte)  st.288 = 値  /  値 = st.288   (lpoke/lpeek も可)
; dwCrcErr : DWORD (+1156, 4byte)  st.289 = 値  /  値 = st.289   (lpoke/lpeek も可)
; dwTimeoutErr : DWORD (+1160, 4byte)  st.290 = 値  /  値 = st.290   (lpoke/lpeek も可)
; dwAlignmentErr : DWORD (+1164, 4byte)  st.291 = 値  /  値 = st.291   (lpoke/lpeek も可)
; dwHardwareOverrunErr : DWORD (+1168, 4byte)  st.292 = 値  /  値 = st.292   (lpoke/lpeek も可)
; dwFramingErr : DWORD (+1172, 4byte)  st.293 = 値  /  値 = st.293   (lpoke/lpeek も可)
; dwBufferOverrunErr : DWORD (+1176, 4byte)  st.294 = 値  /  値 = st.294   (lpoke/lpeek も可)
; dwCompressionRatioIn : DWORD (+1180, 4byte)  st.295 = 値  /  値 = st.295   (lpoke/lpeek も可)
; dwCompressionRatioOut : DWORD (+1184, 4byte)  st.296 = 値  /  値 = st.296   (lpoke/lpeek も可)
; dwNumSwitchOvers : DWORD (+1188, 4byte)  st.297 = 値  /  値 = st.297   (lpoke/lpeek も可)
; wszRemoteEndpointAddress : WCHAR (+1192, 130byte)  varptr(st)+1192 を基点に操作(130byte:入れ子/配列)
; wszLocalEndpointAddress : WCHAR (+1322, 130byte)  varptr(st)+1322 を基点に操作(130byte:入れ子/配列)
; ProjectionInfo : PROJECTION_INFO (+1456, 200byte)  varptr(st)+1456 を基点に操作(200byte:入れ子/配列)
; hConnection : HANDLE (+1656, 4byte)  st.414 = 値  /  値 = st.414   (lpoke/lpeek も可)
; hInterface : HANDLE (+1660, 4byte)  st.415 = 値  /  値 = st.415   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RAS_CONNECTION_EX サイズ: 1672 バイト(x64)
dim st, 418    ; 4byte整数×418(構造体サイズ 1672 / 4 切り上げ)
; Header : MPRAPI_OBJECT_HEADER (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; dwConnectDuration : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwInterfaceType : ROUTER_INTERFACE_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwConnectionFlags : RAS_FLAGS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; wszInterfaceName : WCHAR (+16, 514byte)  varptr(st)+16 を基点に操作(514byte:入れ子/配列)
; wszUserName : WCHAR (+530, 514byte)  varptr(st)+530 を基点に操作(514byte:入れ子/配列)
; wszLogonDomain : WCHAR (+1044, 32byte)  varptr(st)+1044 を基点に操作(32byte:入れ子/配列)
; wszRemoteComputer : WCHAR (+1076, 34byte)  varptr(st)+1076 を基点に操作(34byte:入れ子/配列)
; guid : GUID (+1112, 16byte)  varptr(st)+1112 を基点に操作(16byte:入れ子/配列)
; rasQuarState : RAS_QUARANTINE_STATE (+1128, 4byte)  st.282 = 値  /  値 = st.282   (lpoke/lpeek も可)
; probationTime : FILETIME (+1132, 8byte)  varptr(st)+1132 を基点に操作(8byte:入れ子/配列)
; dwBytesXmited : DWORD (+1140, 4byte)  st.285 = 値  /  値 = st.285   (lpoke/lpeek も可)
; dwBytesRcved : DWORD (+1144, 4byte)  st.286 = 値  /  値 = st.286   (lpoke/lpeek も可)
; dwFramesXmited : DWORD (+1148, 4byte)  st.287 = 値  /  値 = st.287   (lpoke/lpeek も可)
; dwFramesRcved : DWORD (+1152, 4byte)  st.288 = 値  /  値 = st.288   (lpoke/lpeek も可)
; dwCrcErr : DWORD (+1156, 4byte)  st.289 = 値  /  値 = st.289   (lpoke/lpeek も可)
; dwTimeoutErr : DWORD (+1160, 4byte)  st.290 = 値  /  値 = st.290   (lpoke/lpeek も可)
; dwAlignmentErr : DWORD (+1164, 4byte)  st.291 = 値  /  値 = st.291   (lpoke/lpeek も可)
; dwHardwareOverrunErr : DWORD (+1168, 4byte)  st.292 = 値  /  値 = st.292   (lpoke/lpeek も可)
; dwFramingErr : DWORD (+1172, 4byte)  st.293 = 値  /  値 = st.293   (lpoke/lpeek も可)
; dwBufferOverrunErr : DWORD (+1176, 4byte)  st.294 = 値  /  値 = st.294   (lpoke/lpeek も可)
; dwCompressionRatioIn : DWORD (+1180, 4byte)  st.295 = 値  /  値 = st.295   (lpoke/lpeek も可)
; dwCompressionRatioOut : DWORD (+1184, 4byte)  st.296 = 値  /  値 = st.296   (lpoke/lpeek も可)
; dwNumSwitchOvers : DWORD (+1188, 4byte)  st.297 = 値  /  値 = st.297   (lpoke/lpeek も可)
; wszRemoteEndpointAddress : WCHAR (+1192, 130byte)  varptr(st)+1192 を基点に操作(130byte:入れ子/配列)
; wszLocalEndpointAddress : WCHAR (+1322, 130byte)  varptr(st)+1322 を基点に操作(130byte:入れ子/配列)
; ProjectionInfo : PROJECTION_INFO (+1456, 200byte)  varptr(st)+1456 を基点に操作(200byte:入れ子/配列)
; hConnection : HANDLE (+1656, 8byte)  qpoke st,1656,値 / qpeek(st,1656)  ※IronHSPのみ。3.7/3.8は lpoke st,1656,下位 : lpoke st,1660,上位
; hInterface : HANDLE (+1664, 8byte)  qpoke st,1664,値 / qpeek(st,1664)  ※IronHSPのみ。3.7/3.8は lpoke st,1664,下位 : lpoke st,1668,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global MPRAPI_OBJECT_HEADER
    #field byte revision
    #field byte type
    #field short size
#endstruct

#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global PROJECTION_INFO
    #field byte projectionInfoType
    #field byte Anonymous 192
#endstruct

#defstruct global RAS_CONNECTION_EX
    #field MPRAPI_OBJECT_HEADER Header
    #field int dwConnectDuration
    #field int dwInterfaceType
    #field int dwConnectionFlags
    #field wchar wszInterfaceName 257
    #field wchar wszUserName 257
    #field wchar wszLogonDomain 16
    #field wchar wszRemoteComputer 17
    #field GUID guid
    #field int rasQuarState
    #field FILETIME probationTime
    #field int dwBytesXmited
    #field int dwBytesRcved
    #field int dwFramesXmited
    #field int dwFramesRcved
    #field int dwCrcErr
    #field int dwTimeoutErr
    #field int dwAlignmentErr
    #field int dwHardwareOverrunErr
    #field int dwFramingErr
    #field int dwBufferOverrunErr
    #field int dwCompressionRatioIn
    #field int dwCompressionRatioOut
    #field int dwNumSwitchOvers
    #field wchar wszRemoteEndpointAddress 65
    #field wchar wszLocalEndpointAddress 65
    #field PROJECTION_INFO ProjectionInfo
    #field intptr hConnection
    #field intptr hInterface
#endstruct

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