ホーム › NetworkManagement.Rras › RAS_CONNECTION_4
RAS_CONNECTION_4
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwConnectDuration | DWORD | 4 | +0 | +0 | 接続が確立してからの経過時間(ミリ秒)。 |
| dwInterfaceType | ROUTER_INTERFACE_TYPE | 4 | +4 | +4 | インターフェイスの種別を表すROUTER_INTERFACE_TYPE列挙値。 |
| dwConnectionFlags | RAS_FLAGS | 4 | +8 | +8 | 接続の属性を示すRAS_FLAGS列挙値。 |
| wszInterfaceName | WCHAR | 514 | +12 | +12 | 接続に関連付くインターフェイスの名前(ワイド文字列)。 |
| wszUserName | WCHAR | 514 | +526 | +526 | 接続したユーザーの名前(ワイド文字列)。 |
| wszLogonDomain | WCHAR | 32 | +1040 | +1040 | ユーザーがログオンしたドメイン名(ワイド文字列)。 |
| wszRemoteComputer | WCHAR | 34 | +1072 | +1072 | リモートコンピューターの名前(ワイド文字列)。 |
| guid | GUID | 16 | +1108 | +1108 | 接続を一意に識別するGUID。 |
| rasQuarState | RAS_QUARANTINE_STATE | 4 | +1124 | +1124 | ネットワーク検疫の状態を表すRAS_QUARANTINE_STATE列挙値。 |
| probationTime | FILETIME | 8 | +1128 | +1128 | 検疫の試用期間終了時刻を表すFILETIME。 |
| connectionStartTime | FILETIME | 8 | +1136 | +1136 | 接続が開始された時刻を表すFILETIME。 |
| ullBytesXmited | ULONGLONG | 8 | +1144 | +1144 | 送信されたバイト数(64ビット)。 |
| ullBytesRcved | ULONGLONG | 8 | +1152 | +1152 | 受信したバイト数(64ビット)。 |
| dwFramesXmited | DWORD | 4 | +1160 | +1160 | 送信されたフレーム数。 |
| dwFramesRcved | DWORD | 4 | +1164 | +1164 | 受信したフレーム数。 |
| dwCrcErr | DWORD | 4 | +1168 | +1168 | 発生したCRCエラーの数。 |
| dwTimeoutErr | DWORD | 4 | +1172 | +1172 | 発生したタイムアウトエラーの数。 |
| dwAlignmentErr | DWORD | 4 | +1176 | +1176 | 発生したアラインメントエラーの数。 |
| dwHardwareOverrunErr | DWORD | 4 | +1180 | +1180 | 発生したハードウェアオーバーランエラーの数。 |
| dwFramingErr | DWORD | 4 | +1184 | +1184 | 発生したフレーミングエラーの数。 |
| dwBufferOverrunErr | DWORD | 4 | +1188 | +1188 | 発生したバッファオーバーランエラーの数。 |
| dwCompressionRatioIn | DWORD | 4 | +1192 | +1192 | 受信データの圧縮率(%)。 |
| dwCompressionRatioOut | DWORD | 4 | +1196 | +1196 | 送信データの圧縮率(%)。 |
| dwNumSwitchOvers | DWORD | 4 | +1200 | +1200 | 接続が別エンドポイントへ切り替わった回数。 |
| wszRemoteEndpointAddress | WCHAR | 130 | +1204 | +1204 | リモート側VPNエンドポイントのアドレス(ワイド文字列)。 |
| wszLocalEndpointAddress | WCHAR | 130 | +1334 | +1334 | ローカル側VPNエンドポイントのアドレス(ワイド文字列)。 |
| ProjectionInfo | PROJECTION_INFO2 | 208 | +1464 | +1464 | 接続のプロジェクション情報(PROJECTION_INFO2)。 |
| hConnection | HANDLE | 8/4 | +1672 | +1672 | 接続を識別するハンドル。 |
| hInterface | HANDLE | 8/4 | +1680 | +1676 | 接続に関連付くインターフェイスのハンドル。 |
| dwDeviceType | DWORD | 4 | +1688 | +1680 | 接続に使用されたデバイスの種別を表す値。 |
各言語での定義
#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 Structureimport 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: uint32struct 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