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

RAS_CONNECTION_4

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

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

フィールド

フィールドサイズx64x86説明
dwConnectDurationDWORD4+0+0接続の継続時間を秒単位で表す値です。
dwInterfaceTypeROUTER_INTERFACE_TYPE4+4+4接続インターフェイスの種類を示す ROUTER_INTERFACE_TYPE 列挙型です。
dwConnectionFlagsRAS_FLAGS4+8+8

接続の属性を指定するフラグのビットマップです。dwConnectionFlags メンバーには、次の値のうち少なくとも 1 つが含まれていなければなりません。

意味
RAS_FLAGS_PPP_CONNECTION
0x00000001
接続は Point-to-Point Protocol (PPP) を使用しています。
RAS_FLAGS_MESSENGER_PRESENT
0x00000002
クライアント上で Messenger サービスが動作しており、MprAdminSendUserMessage 関数を使用してクライアントにメッセージを送信できます。
RAS_FLAGS_QUARANTINE_PRESENT
0x00000008
接続は現在検疫状態にあります。接続を検疫から解除する方法については、MprAdminConnectionRemoveQuarantine を参照してください。
RAS_FLAGS_ARAP_CONNECTION
0x00000010
接続は AppleTalk Remote Access Protocol (ARAP) を使用しています。
RAS_FLAGS_IKEV2_CONNECTION
0x00000010
接続は IKEv2 を使用しています。
RAS_FLAGS_DORMANT
0x00000020
接続は IKEv2 を使用しており、サーバーに到達できません。
wszInterfaceNameWCHAR514+12+12この接続のインターフェイス名を格納する、null で終わる Unicode 文字列です。
wszUserNameWCHAR514+526+526接続にログオンしているユーザーの名前を格納する、null で終わる Unicode 文字列です。
wszLogonDomainWCHAR32+1040+1040接続したユーザーが認証されたドメインを格納する、null で終わる Unicode 文字列です。
wszRemoteComputerWCHAR34+1072+1072リモート コンピューターの名前を格納する、null で終わる Unicode 文字列です。
guidGUID16+1108+1108接続を識別する GUID です。着信接続の場合、この GUID は接続がアクティブな間のみ有効です。
rasQuarStateRAS_QUARANTINE_STATE4+1124+1124接続の NAP 検疫状態を指定する RAS_QUARANTINE_STATE 構造体です。
probationTimeFILETIME8+1128+1128接続が検疫から解除されるまでに要する時間を指定する FILETIME 構造体です。この時間を過ぎると接続は切断されます。この値は、rasQuarState メンバーの値が RAS_QUAR_STATE_PROBATION の場合にのみ有効です。
connectionStartTimeFILETIME8+1136+1136接続の開始時刻を UTC で指定する FILETIME 構造体です。
ullBytesXmitedULONGLONG8+1144+1144接続で送信されたバイト数を指定する値です。
ullBytesRcvedULONGLONG8+1152+1152接続で受信したバイト数を指定する値です。
dwFramesXmitedDWORD4+1160+1160接続で送信されたフレーム数を指定する値です。
dwFramesRcvedDWORD4+1164+1164接続で受信したフレーム数を指定する値です。
dwCrcErrDWORD4+1168+1168接続で発生した巡回冗長検査 (CRC) エラーの数を指定する値です。
dwTimeoutErrDWORD4+1172+1172接続で発生したタイムアウト エラーの数を指定する値です。
dwAlignmentErrDWORD4+1176+1176接続で発生したアライメント エラーの数を指定する値です。
dwHardwareOverrunErrDWORD4+1180+1180接続で発生したハードウェア オーバーラン エラーの数を指定する値です。
dwFramingErrDWORD4+1184+1184接続で発生したフレーミング エラーの数を指定する値です。
dwBufferOverrunErrDWORD4+1188+1188接続で発生したバッファー オーバーラン エラーの数を指定する値です。
dwCompressionRatioInDWORD4+1192+1192この接続で受信したデータが圧縮されている割合をパーセントで指定する値です。dwCompressionRatioIn メンバーは、圧縮されたデータのサイズを、同じデータの非圧縮状態でのサイズで割った値です。
dwCompressionRatioOutDWORD4+1196+1196この接続で送信されるデータが圧縮されている割合をパーセントで指定する値です。この比率は、圧縮されたデータのサイズを、同じデータの非圧縮状態でのサイズで割った値です。
dwNumSwitchOversDWORD4+1200+1200接続で発生した IKEv2 Mobility and Multihoming Protocol (MOBIKE) の切り替え回数を指定する値です。dwNumSwitchOvers メンバーは、dwConnectionFlags メンバーが RAS_FLAGS_IKEV2_CONNECTION の場合にのみ有効です。
wszRemoteEndpointAddressWCHAR130+1204+1204接続におけるリモート コンピューターの IP アドレスを格納する、null で終わる Unicode 文字列です。この文字列は "a.b.c.d" の形式です。
wszLocalEndpointAddressWCHAR130+1334+1334接続におけるローカル コンピューターの IP アドレスを格納する、null で終わる Unicode 文字列です。この文字列は "a.b.c.d" の形式です。
ProjectionInfoPROJECTION_INFO2208+1464+1464PROJECTION_INFO2 構造体で、PPP_PROJECTION_INFO2 構造体または IKEV2_PROJECTION_INFO2 構造体のいずれかを格納します。
hConnectionHANDLE8/4+1672+1672RAS 接続へのハンドルです。
hInterfaceHANDLE8/4+1680+1676RAS 接続インターフェイスへのハンドルです。
dwDeviceTypeDWORD4+1688+1680

VPN 接続のトンネルの種類を指定する値です。次の表に、このメンバーに指定できる値を示します。

意味
RDT_Tunnel_Pptp
Point-to-Point トンネル (PPTP)
RDT_Tunnel_L2tp
L2TP トンネル
RDT_Tunnel_Sstp
SSTP トンネル
RDT_Tunnel_IKev2
IKEv2 トンネル

公式ドキュメント

接続に固有の情報を格納します。この情報には、ユーザー名、ドメイン、接続に関連付けられたグローバル一意識別子 (GUID)、ネットワーク アクセス保護 (NAP) の検疫状態、パケット統計、および Point-to-Point (PPP) と Internet Key Exchange version 2 (IKEv2) に関する情報が含まれます。

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

各言語での定義

#include <windows.h>

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

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

// RAS_CONNECTION_4  (x64 1696 / x86 1688 バイト)
typedef struct RAS_CONNECTION_4 {
    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;
    FILETIME connectionStartTime;
    ULONGLONG ullBytesXmited;
    ULONGLONG ullBytesRcved;
    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_INFO2 ProjectionInfo;
    HANDLE hConnection;
    HANDLE hInterface;
    DWORD dwDeviceType;
} RAS_CONNECTION_4;
using System;
using System.Runtime.InteropServices;

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

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

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RAS_CONNECTION_4
{
    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 FILETIME connectionStartTime;
    public ulong ullBytesXmited;
    public ulong ullBytesRcved;
    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_INFO2 ProjectionInfo;
    public IntPtr hConnection;
    public IntPtr hInterface;
    public uint dwDeviceType;
}
Imports System.Runtime.InteropServices

<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_INFO2
    Public projectionInfoType As Byte
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RAS_CONNECTION_4
    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 connectionStartTime As FILETIME
    Public ullBytesXmited As ULong
    Public ullBytesRcved As ULong
    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_INFO2
    Public hConnection As IntPtr
    Public hInterface As IntPtr
    Public dwDeviceType As UInteger
End Structure
import ctypes
from ctypes import wintypes

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

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

class RAS_CONNECTION_4(ctypes.Structure):
    _fields_ = [
        ("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),
        ("connectionStartTime", FILETIME),
        ("ullBytesXmited", ctypes.c_ulonglong),
        ("ullBytesRcved", ctypes.c_ulonglong),
        ("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_INFO2),
        ("hConnection", ctypes.c_void_p),
        ("hInterface", ctypes.c_void_p),
        ("dwDeviceType", wintypes.DWORD),
    ]
#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

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

#[repr(C)]
pub struct RAS_CONNECTION_4 {
    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 connectionStartTime: FILETIME,
    pub ullBytesXmited: u64,
    pub ullBytesRcved: u64,
    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_INFO2,
    pub hConnection: *mut core::ffi::c_void,
    pub hInterface: *mut core::ffi::c_void,
    pub dwDeviceType: u32,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type PROJECTION_INFO2 struct {
	projectionInfoType byte
	Anonymous _Anonymous_e__Union
}

type RAS_CONNECTION_4 struct {
	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
	connectionStartTime FILETIME
	ullBytesXmited uint64
	ullBytesRcved uint64
	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_INFO2
	hConnection uintptr
	hInterface uintptr
	dwDeviceType uint32
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

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

  RAS_CONNECTION_4 = record
    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;
    connectionStartTime: FILETIME;
    ullBytesXmited: UInt64;
    ullBytesRcved: UInt64;
    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_INFO2;
    hConnection: Pointer;
    hInterface: Pointer;
    dwDeviceType: DWORD;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

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

const RAS_CONNECTION_4 = extern struct {
    dwConnectDuration: u32,
    dwInterfaceType: i32,
    dwConnectionFlags: u32,
    wszInterfaceName: [257]u16,
    wszUserName: [257]u16,
    wszLogonDomain: [16]u16,
    wszRemoteComputer: [17]u16,
    guid: GUID,
    rasQuarState: i32,
    probationTime: FILETIME,
    connectionStartTime: FILETIME,
    ullBytesXmited: u64,
    ullBytesRcved: u64,
    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_INFO2,
    hConnection: ?*anyopaque,
    hInterface: ?*anyopaque,
    dwDeviceType: u32,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

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

  RAS_CONNECTION_4 {.bycopy.} = object
    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
    connectionStartTime: FILETIME
    ullBytesXmited: uint64
    ullBytesRcved: uint64
    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_INFO2
    hConnection: pointer
    hInterface: pointer
    dwDeviceType: uint32
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct PROJECTION_INFO2
{
    ubyte projectionInfoType;
    _Anonymous_e__Union Anonymous;
}

struct RAS_CONNECTION_4
{
    uint dwConnectDuration;
    int dwInterfaceType;
    uint dwConnectionFlags;
    wchar[257] wszInterfaceName;
    wchar[257] wszUserName;
    wchar[16] wszLogonDomain;
    wchar[17] wszRemoteComputer;
    GUID guid;
    int rasQuarState;
    FILETIME probationTime;
    FILETIME connectionStartTime;
    ulong ullBytesXmited;
    ulong ullBytesRcved;
    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_INFO2 ProjectionInfo;
    void* hConnection;
    void* hInterface;
    uint dwDeviceType;
}

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_4 サイズ: 1688 バイト(x86)
dim st, 422    ; 4byte整数×422(構造体サイズ 1688 / 4 切り上げ)
; dwConnectDuration : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwInterfaceType : ROUTER_INTERFACE_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwConnectionFlags : RAS_FLAGS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; wszInterfaceName : WCHAR (+12, 514byte)  varptr(st)+12 を基点に操作(514byte:入れ子/配列)
; wszUserName : WCHAR (+526, 514byte)  varptr(st)+526 を基点に操作(514byte:入れ子/配列)
; wszLogonDomain : WCHAR (+1040, 32byte)  varptr(st)+1040 を基点に操作(32byte:入れ子/配列)
; wszRemoteComputer : WCHAR (+1072, 34byte)  varptr(st)+1072 を基点に操作(34byte:入れ子/配列)
; guid : GUID (+1108, 16byte)  varptr(st)+1108 を基点に操作(16byte:入れ子/配列)
; rasQuarState : RAS_QUARANTINE_STATE (+1124, 4byte)  st.281 = 値  /  値 = st.281   (lpoke/lpeek も可)
; probationTime : FILETIME (+1128, 8byte)  varptr(st)+1128 を基点に操作(8byte:入れ子/配列)
; connectionStartTime : FILETIME (+1136, 8byte)  varptr(st)+1136 を基点に操作(8byte:入れ子/配列)
; ullBytesXmited : ULONGLONG (+1144, 8byte)  qpoke st,1144,値 / qpeek(st,1144)  ※IronHSPのみ。3.7/3.8は lpoke st,1144,下位 : lpoke st,1148,上位
; ullBytesRcved : ULONGLONG (+1152, 8byte)  qpoke st,1152,値 / qpeek(st,1152)  ※IronHSPのみ。3.7/3.8は lpoke st,1152,下位 : lpoke st,1156,上位
; dwFramesXmited : DWORD (+1160, 4byte)  st.290 = 値  /  値 = st.290   (lpoke/lpeek も可)
; dwFramesRcved : DWORD (+1164, 4byte)  st.291 = 値  /  値 = st.291   (lpoke/lpeek も可)
; dwCrcErr : DWORD (+1168, 4byte)  st.292 = 値  /  値 = st.292   (lpoke/lpeek も可)
; dwTimeoutErr : DWORD (+1172, 4byte)  st.293 = 値  /  値 = st.293   (lpoke/lpeek も可)
; dwAlignmentErr : DWORD (+1176, 4byte)  st.294 = 値  /  値 = st.294   (lpoke/lpeek も可)
; dwHardwareOverrunErr : DWORD (+1180, 4byte)  st.295 = 値  /  値 = st.295   (lpoke/lpeek も可)
; dwFramingErr : DWORD (+1184, 4byte)  st.296 = 値  /  値 = st.296   (lpoke/lpeek も可)
; dwBufferOverrunErr : DWORD (+1188, 4byte)  st.297 = 値  /  値 = st.297   (lpoke/lpeek も可)
; dwCompressionRatioIn : DWORD (+1192, 4byte)  st.298 = 値  /  値 = st.298   (lpoke/lpeek も可)
; dwCompressionRatioOut : DWORD (+1196, 4byte)  st.299 = 値  /  値 = st.299   (lpoke/lpeek も可)
; dwNumSwitchOvers : DWORD (+1200, 4byte)  st.300 = 値  /  値 = st.300   (lpoke/lpeek も可)
; wszRemoteEndpointAddress : WCHAR (+1204, 130byte)  varptr(st)+1204 を基点に操作(130byte:入れ子/配列)
; wszLocalEndpointAddress : WCHAR (+1334, 130byte)  varptr(st)+1334 を基点に操作(130byte:入れ子/配列)
; ProjectionInfo : PROJECTION_INFO2 (+1464, 208byte)  varptr(st)+1464 を基点に操作(208byte:入れ子/配列)
; hConnection : HANDLE (+1672, 4byte)  st.418 = 値  /  値 = st.418   (lpoke/lpeek も可)
; hInterface : HANDLE (+1676, 4byte)  st.419 = 値  /  値 = st.419   (lpoke/lpeek も可)
; dwDeviceType : DWORD (+1680, 4byte)  st.420 = 値  /  値 = st.420   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RAS_CONNECTION_4 サイズ: 1696 バイト(x64)
dim st, 424    ; 4byte整数×424(構造体サイズ 1696 / 4 切り上げ)
; dwConnectDuration : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwInterfaceType : ROUTER_INTERFACE_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwConnectionFlags : RAS_FLAGS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; wszInterfaceName : WCHAR (+12, 514byte)  varptr(st)+12 を基点に操作(514byte:入れ子/配列)
; wszUserName : WCHAR (+526, 514byte)  varptr(st)+526 を基点に操作(514byte:入れ子/配列)
; wszLogonDomain : WCHAR (+1040, 32byte)  varptr(st)+1040 を基点に操作(32byte:入れ子/配列)
; wszRemoteComputer : WCHAR (+1072, 34byte)  varptr(st)+1072 を基点に操作(34byte:入れ子/配列)
; guid : GUID (+1108, 16byte)  varptr(st)+1108 を基点に操作(16byte:入れ子/配列)
; rasQuarState : RAS_QUARANTINE_STATE (+1124, 4byte)  st.281 = 値  /  値 = st.281   (lpoke/lpeek も可)
; probationTime : FILETIME (+1128, 8byte)  varptr(st)+1128 を基点に操作(8byte:入れ子/配列)
; connectionStartTime : FILETIME (+1136, 8byte)  varptr(st)+1136 を基点に操作(8byte:入れ子/配列)
; ullBytesXmited : ULONGLONG (+1144, 8byte)  qpoke st,1144,値 / qpeek(st,1144)  ※IronHSPのみ。3.7/3.8は lpoke st,1144,下位 : lpoke st,1148,上位
; ullBytesRcved : ULONGLONG (+1152, 8byte)  qpoke st,1152,値 / qpeek(st,1152)  ※IronHSPのみ。3.7/3.8は lpoke st,1152,下位 : lpoke st,1156,上位
; dwFramesXmited : DWORD (+1160, 4byte)  st.290 = 値  /  値 = st.290   (lpoke/lpeek も可)
; dwFramesRcved : DWORD (+1164, 4byte)  st.291 = 値  /  値 = st.291   (lpoke/lpeek も可)
; dwCrcErr : DWORD (+1168, 4byte)  st.292 = 値  /  値 = st.292   (lpoke/lpeek も可)
; dwTimeoutErr : DWORD (+1172, 4byte)  st.293 = 値  /  値 = st.293   (lpoke/lpeek も可)
; dwAlignmentErr : DWORD (+1176, 4byte)  st.294 = 値  /  値 = st.294   (lpoke/lpeek も可)
; dwHardwareOverrunErr : DWORD (+1180, 4byte)  st.295 = 値  /  値 = st.295   (lpoke/lpeek も可)
; dwFramingErr : DWORD (+1184, 4byte)  st.296 = 値  /  値 = st.296   (lpoke/lpeek も可)
; dwBufferOverrunErr : DWORD (+1188, 4byte)  st.297 = 値  /  値 = st.297   (lpoke/lpeek も可)
; dwCompressionRatioIn : DWORD (+1192, 4byte)  st.298 = 値  /  値 = st.298   (lpoke/lpeek も可)
; dwCompressionRatioOut : DWORD (+1196, 4byte)  st.299 = 値  /  値 = st.299   (lpoke/lpeek も可)
; dwNumSwitchOvers : DWORD (+1200, 4byte)  st.300 = 値  /  値 = st.300   (lpoke/lpeek も可)
; wszRemoteEndpointAddress : WCHAR (+1204, 130byte)  varptr(st)+1204 を基点に操作(130byte:入れ子/配列)
; wszLocalEndpointAddress : WCHAR (+1334, 130byte)  varptr(st)+1334 を基点に操作(130byte:入れ子/配列)
; ProjectionInfo : PROJECTION_INFO2 (+1464, 208byte)  varptr(st)+1464 を基点に操作(208byte:入れ子/配列)
; hConnection : HANDLE (+1672, 8byte)  qpoke st,1672,値 / qpeek(st,1672)  ※IronHSPのみ。3.7/3.8は lpoke st,1672,下位 : lpoke st,1676,上位
; hInterface : HANDLE (+1680, 8byte)  qpoke st,1680,値 / qpeek(st,1680)  ※IronHSPのみ。3.7/3.8は lpoke st,1680,下位 : lpoke st,1684,上位
; dwDeviceType : DWORD (+1688, 4byte)  st.422 = 値  /  値 = st.422   (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 FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global PROJECTION_INFO2
    #field byte projectionInfoType
    #field byte Anonymous 200
#endstruct

#defstruct global RAS_CONNECTION_4
    #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 FILETIME connectionStartTime
    #field int64 ullBytesXmited
    #field int64 ullBytesRcved
    #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_INFO2 ProjectionInfo
    #field intptr hConnection
    #field intptr hInterface
    #field int dwDeviceType
#endstruct

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