ホーム › NetworkManagement.WindowsFilteringPlatform › IKEEXT_SA_DETAILS1
IKEEXT_SA_DETAILS1
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| saId | ULONGLONG | 8 | +0 | +0 | セキュリティアソシエーションを一意に識別する64ビットID。 |
| keyModuleType | IKEEXT_KEY_MODULE_TYPE | 4 | +8 | +8 | SAを管理する鍵モジュール種別(IKE/AuthIP等)。 |
| ipVersion | FWP_IP_VERSION | 4 | +12 | +12 | SAのIPバージョンを示す列挙値。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +16 | +16 | IPバージョンに応じたトラフィック情報を保持する無名共用体。 |
| ikeTraffic | IKEEXT_TRAFFIC0 | 48 | +24 | +24 | SAに関連付くトラフィック情報。 |
| ikeProposal | IKEEXT_PROPOSAL0 | 28 | +72 | +72 | ネゴシエート済みのIKEプロポーザル。 |
| cookiePair | IKEEXT_COOKIE_PAIR0 | 16 | +104 | +104 | イニシエーター/レスポンダーのクッキーペア。 |
| ikeCredentials | IKEEXT_CREDENTIALS1 | 16/8 | +120 | +120 | SAで使用された資格情報。 |
| ikePolicyKey | GUID | 16 | +136 | +128 | 適用されたIKEポリシーを識別するGUID。 |
| virtualIfTunnelId | ULONGLONG | 8 | +152 | +144 | 仮想インターフェーストンネルID(該当時)。 |
| correlationKey | FWP_BYTE_BLOB | 16/8 | +160 | +152 | イベント相関に用いる相関キー(バイトブロブ)。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| v4UdpEncapsulation | IPSEC_V4_UDP_ENCAPSULATION0* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// IKEEXT_TRAFFIC0 (x64 48 / x86 48 バイト)
typedef struct IKEEXT_TRAFFIC0 {
FWP_IP_VERSION ipVersion;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
ULONGLONG authIpFilterId;
} IKEEXT_TRAFFIC0;
// IKEEXT_CIPHER_ALGORITHM0 (x64 12 / x86 12 バイト)
typedef struct IKEEXT_CIPHER_ALGORITHM0 {
IKEEXT_CIPHER_TYPE algoIdentifier;
DWORD keyLen;
DWORD rounds;
} IKEEXT_CIPHER_ALGORITHM0;
// IKEEXT_INTEGRITY_ALGORITHM0 (x64 4 / x86 4 バイト)
typedef struct IKEEXT_INTEGRITY_ALGORITHM0 {
IKEEXT_INTEGRITY_TYPE algoIdentifier;
} IKEEXT_INTEGRITY_ALGORITHM0;
// IKEEXT_PROPOSAL0 (x64 28 / x86 28 バイト)
typedef struct IKEEXT_PROPOSAL0 {
IKEEXT_CIPHER_ALGORITHM0 cipherAlgorithm;
IKEEXT_INTEGRITY_ALGORITHM0 integrityAlgorithm;
DWORD maxLifetimeSeconds;
IKEEXT_DH_GROUP dhGroup;
DWORD quickModeLimit;
} IKEEXT_PROPOSAL0;
// IKEEXT_COOKIE_PAIR0 (x64 16 / x86 16 バイト)
typedef struct IKEEXT_COOKIE_PAIR0 {
ULONGLONG initiator;
ULONGLONG responder;
} IKEEXT_COOKIE_PAIR0;
// IKEEXT_CREDENTIALS1 (x64 16 / x86 8 バイト)
typedef struct IKEEXT_CREDENTIALS1 {
DWORD numCredentials;
IKEEXT_CREDENTIAL_PAIR1* credentials;
} IKEEXT_CREDENTIALS1;
// FWP_BYTE_BLOB (x64 16 / x86 8 バイト)
typedef struct FWP_BYTE_BLOB {
DWORD size;
BYTE* data;
} FWP_BYTE_BLOB;
// IKEEXT_SA_DETAILS1 (x64 176 / x86 160 バイト)
typedef struct IKEEXT_SA_DETAILS1 {
ULONGLONG saId;
IKEEXT_KEY_MODULE_TYPE keyModuleType;
FWP_IP_VERSION ipVersion;
_Anonymous_e__Union Anonymous;
IKEEXT_TRAFFIC0 ikeTraffic;
IKEEXT_PROPOSAL0 ikeProposal;
IKEEXT_COOKIE_PAIR0 cookiePair;
IKEEXT_CREDENTIALS1 ikeCredentials;
GUID ikePolicyKey;
ULONGLONG virtualIfTunnelId;
FWP_BYTE_BLOB correlationKey;
} IKEEXT_SA_DETAILS1;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_TRAFFIC0
{
public int ipVersion;
public _Anonymous1_e__Union Anonymous1;
public _Anonymous2_e__Union Anonymous2;
public ulong authIpFilterId;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_CIPHER_ALGORITHM0
{
public int algoIdentifier;
public uint keyLen;
public uint rounds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_INTEGRITY_ALGORITHM0
{
public int algoIdentifier;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_PROPOSAL0
{
public IKEEXT_CIPHER_ALGORITHM0 cipherAlgorithm;
public IKEEXT_INTEGRITY_ALGORITHM0 integrityAlgorithm;
public uint maxLifetimeSeconds;
public int dhGroup;
public uint quickModeLimit;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_COOKIE_PAIR0
{
public ulong initiator;
public ulong responder;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_CREDENTIALS1
{
public uint numCredentials;
public IntPtr credentials;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FWP_BYTE_BLOB
{
public uint size;
public IntPtr data;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_SA_DETAILS1
{
public ulong saId;
public int keyModuleType;
public int ipVersion;
public _Anonymous_e__Union Anonymous;
public IKEEXT_TRAFFIC0 ikeTraffic;
public IKEEXT_PROPOSAL0 ikeProposal;
public IKEEXT_COOKIE_PAIR0 cookiePair;
public IKEEXT_CREDENTIALS1 ikeCredentials;
public Guid ikePolicyKey;
public ulong virtualIfTunnelId;
public FWP_BYTE_BLOB correlationKey;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_TRAFFIC0
Public ipVersion As Integer
Public Anonymous1 As _Anonymous1_e__Union
Public Anonymous2 As _Anonymous2_e__Union
Public authIpFilterId As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_CIPHER_ALGORITHM0
Public algoIdentifier As Integer
Public keyLen As UInteger
Public rounds As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_INTEGRITY_ALGORITHM0
Public algoIdentifier As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_PROPOSAL0
Public cipherAlgorithm As IKEEXT_CIPHER_ALGORITHM0
Public integrityAlgorithm As IKEEXT_INTEGRITY_ALGORITHM0
Public maxLifetimeSeconds As UInteger
Public dhGroup As Integer
Public quickModeLimit As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_COOKIE_PAIR0
Public initiator As ULong
Public responder As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_CREDENTIALS1
Public numCredentials As UInteger
Public credentials As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FWP_BYTE_BLOB
Public size As UInteger
Public data As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_SA_DETAILS1
Public saId As ULong
Public keyModuleType As Integer
Public ipVersion As Integer
Public Anonymous As _Anonymous_e__Union
Public ikeTraffic As IKEEXT_TRAFFIC0
Public ikeProposal As IKEEXT_PROPOSAL0
Public cookiePair As IKEEXT_COOKIE_PAIR0
Public ikeCredentials As IKEEXT_CREDENTIALS1
Public ikePolicyKey As Guid
Public virtualIfTunnelId As ULong
Public correlationKey As FWP_BYTE_BLOB
End Structureimport ctypes
from ctypes import wintypes
class IKEEXT_TRAFFIC0(ctypes.Structure):
_fields_ = [
("ipVersion", ctypes.c_int),
("Anonymous1", _Anonymous1_e__Union),
("Anonymous2", _Anonymous2_e__Union),
("authIpFilterId", ctypes.c_ulonglong),
]
class IKEEXT_CIPHER_ALGORITHM0(ctypes.Structure):
_fields_ = [
("algoIdentifier", ctypes.c_int),
("keyLen", wintypes.DWORD),
("rounds", wintypes.DWORD),
]
class IKEEXT_INTEGRITY_ALGORITHM0(ctypes.Structure):
_fields_ = [
("algoIdentifier", ctypes.c_int),
]
class IKEEXT_PROPOSAL0(ctypes.Structure):
_fields_ = [
("cipherAlgorithm", IKEEXT_CIPHER_ALGORITHM0),
("integrityAlgorithm", IKEEXT_INTEGRITY_ALGORITHM0),
("maxLifetimeSeconds", wintypes.DWORD),
("dhGroup", ctypes.c_int),
("quickModeLimit", wintypes.DWORD),
]
class IKEEXT_COOKIE_PAIR0(ctypes.Structure):
_fields_ = [
("initiator", ctypes.c_ulonglong),
("responder", ctypes.c_ulonglong),
]
class IKEEXT_CREDENTIALS1(ctypes.Structure):
_fields_ = [
("numCredentials", wintypes.DWORD),
("credentials", ctypes.c_void_p),
]
class FWP_BYTE_BLOB(ctypes.Structure):
_fields_ = [
("size", wintypes.DWORD),
("data", ctypes.c_void_p),
]
class IKEEXT_SA_DETAILS1(ctypes.Structure):
_fields_ = [
("saId", ctypes.c_ulonglong),
("keyModuleType", ctypes.c_int),
("ipVersion", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
("ikeTraffic", IKEEXT_TRAFFIC0),
("ikeProposal", IKEEXT_PROPOSAL0),
("cookiePair", IKEEXT_COOKIE_PAIR0),
("ikeCredentials", IKEEXT_CREDENTIALS1),
("ikePolicyKey", GUID),
("virtualIfTunnelId", ctypes.c_ulonglong),
("correlationKey", FWP_BYTE_BLOB),
]#[repr(C)]
pub struct IKEEXT_TRAFFIC0 {
pub ipVersion: i32,
pub Anonymous1: _Anonymous1_e__Union,
pub Anonymous2: _Anonymous2_e__Union,
pub authIpFilterId: u64,
}
#[repr(C)]
pub struct IKEEXT_CIPHER_ALGORITHM0 {
pub algoIdentifier: i32,
pub keyLen: u32,
pub rounds: u32,
}
#[repr(C)]
pub struct IKEEXT_INTEGRITY_ALGORITHM0 {
pub algoIdentifier: i32,
}
#[repr(C)]
pub struct IKEEXT_PROPOSAL0 {
pub cipherAlgorithm: IKEEXT_CIPHER_ALGORITHM0,
pub integrityAlgorithm: IKEEXT_INTEGRITY_ALGORITHM0,
pub maxLifetimeSeconds: u32,
pub dhGroup: i32,
pub quickModeLimit: u32,
}
#[repr(C)]
pub struct IKEEXT_COOKIE_PAIR0 {
pub initiator: u64,
pub responder: u64,
}
#[repr(C)]
pub struct IKEEXT_CREDENTIALS1 {
pub numCredentials: u32,
pub credentials: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct FWP_BYTE_BLOB {
pub size: u32,
pub data: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct IKEEXT_SA_DETAILS1 {
pub saId: u64,
pub keyModuleType: i32,
pub ipVersion: i32,
pub Anonymous: _Anonymous_e__Union,
pub ikeTraffic: IKEEXT_TRAFFIC0,
pub ikeProposal: IKEEXT_PROPOSAL0,
pub cookiePair: IKEEXT_COOKIE_PAIR0,
pub ikeCredentials: IKEEXT_CREDENTIALS1,
pub ikePolicyKey: GUID,
pub virtualIfTunnelId: u64,
pub correlationKey: FWP_BYTE_BLOB,
}import "golang.org/x/sys/windows"
type IKEEXT_TRAFFIC0 struct {
ipVersion int32
Anonymous1 _Anonymous1_e__Union
Anonymous2 _Anonymous2_e__Union
authIpFilterId uint64
}
type IKEEXT_CIPHER_ALGORITHM0 struct {
algoIdentifier int32
keyLen uint32
rounds uint32
}
type IKEEXT_INTEGRITY_ALGORITHM0 struct {
algoIdentifier int32
}
type IKEEXT_PROPOSAL0 struct {
cipherAlgorithm IKEEXT_CIPHER_ALGORITHM0
integrityAlgorithm IKEEXT_INTEGRITY_ALGORITHM0
maxLifetimeSeconds uint32
dhGroup int32
quickModeLimit uint32
}
type IKEEXT_COOKIE_PAIR0 struct {
initiator uint64
responder uint64
}
type IKEEXT_CREDENTIALS1 struct {
numCredentials uint32
credentials uintptr
}
type FWP_BYTE_BLOB struct {
size uint32
data uintptr
}
type IKEEXT_SA_DETAILS1 struct {
saId uint64
keyModuleType int32
ipVersion int32
Anonymous _Anonymous_e__Union
ikeTraffic IKEEXT_TRAFFIC0
ikeProposal IKEEXT_PROPOSAL0
cookiePair IKEEXT_COOKIE_PAIR0
ikeCredentials IKEEXT_CREDENTIALS1
ikePolicyKey windows.GUID
virtualIfTunnelId uint64
correlationKey FWP_BYTE_BLOB
}type
IKEEXT_TRAFFIC0 = record
ipVersion: Integer;
Anonymous1: _Anonymous1_e__Union;
Anonymous2: _Anonymous2_e__Union;
authIpFilterId: UInt64;
end;
IKEEXT_CIPHER_ALGORITHM0 = record
algoIdentifier: Integer;
keyLen: DWORD;
rounds: DWORD;
end;
IKEEXT_INTEGRITY_ALGORITHM0 = record
algoIdentifier: Integer;
end;
IKEEXT_PROPOSAL0 = record
cipherAlgorithm: IKEEXT_CIPHER_ALGORITHM0;
integrityAlgorithm: IKEEXT_INTEGRITY_ALGORITHM0;
maxLifetimeSeconds: DWORD;
dhGroup: Integer;
quickModeLimit: DWORD;
end;
IKEEXT_COOKIE_PAIR0 = record
initiator: UInt64;
responder: UInt64;
end;
IKEEXT_CREDENTIALS1 = record
numCredentials: DWORD;
credentials: Pointer;
end;
FWP_BYTE_BLOB = record
size: DWORD;
data: Pointer;
end;
IKEEXT_SA_DETAILS1 = record
saId: UInt64;
keyModuleType: Integer;
ipVersion: Integer;
Anonymous: _Anonymous_e__Union;
ikeTraffic: IKEEXT_TRAFFIC0;
ikeProposal: IKEEXT_PROPOSAL0;
cookiePair: IKEEXT_COOKIE_PAIR0;
ikeCredentials: IKEEXT_CREDENTIALS1;
ikePolicyKey: TGUID;
virtualIfTunnelId: UInt64;
correlationKey: FWP_BYTE_BLOB;
end;const IKEEXT_TRAFFIC0 = extern struct {
ipVersion: i32,
Anonymous1: _Anonymous1_e__Union,
Anonymous2: _Anonymous2_e__Union,
authIpFilterId: u64,
};
const IKEEXT_CIPHER_ALGORITHM0 = extern struct {
algoIdentifier: i32,
keyLen: u32,
rounds: u32,
};
const IKEEXT_INTEGRITY_ALGORITHM0 = extern struct {
algoIdentifier: i32,
};
const IKEEXT_PROPOSAL0 = extern struct {
cipherAlgorithm: IKEEXT_CIPHER_ALGORITHM0,
integrityAlgorithm: IKEEXT_INTEGRITY_ALGORITHM0,
maxLifetimeSeconds: u32,
dhGroup: i32,
quickModeLimit: u32,
};
const IKEEXT_COOKIE_PAIR0 = extern struct {
initiator: u64,
responder: u64,
};
const IKEEXT_CREDENTIALS1 = extern struct {
numCredentials: u32,
credentials: ?*anyopaque,
};
const FWP_BYTE_BLOB = extern struct {
size: u32,
data: ?*anyopaque,
};
const IKEEXT_SA_DETAILS1 = extern struct {
saId: u64,
keyModuleType: i32,
ipVersion: i32,
Anonymous: _Anonymous_e__Union,
ikeTraffic: IKEEXT_TRAFFIC0,
ikeProposal: IKEEXT_PROPOSAL0,
cookiePair: IKEEXT_COOKIE_PAIR0,
ikeCredentials: IKEEXT_CREDENTIALS1,
ikePolicyKey: GUID,
virtualIfTunnelId: u64,
correlationKey: FWP_BYTE_BLOB,
};type
IKEEXT_TRAFFIC0 {.bycopy.} = object
ipVersion: int32
Anonymous1: _Anonymous1_e__Union
Anonymous2: _Anonymous2_e__Union
authIpFilterId: uint64
IKEEXT_CIPHER_ALGORITHM0 {.bycopy.} = object
algoIdentifier: int32
keyLen: uint32
rounds: uint32
IKEEXT_INTEGRITY_ALGORITHM0 {.bycopy.} = object
algoIdentifier: int32
IKEEXT_PROPOSAL0 {.bycopy.} = object
cipherAlgorithm: IKEEXT_CIPHER_ALGORITHM0
integrityAlgorithm: IKEEXT_INTEGRITY_ALGORITHM0
maxLifetimeSeconds: uint32
dhGroup: int32
quickModeLimit: uint32
IKEEXT_COOKIE_PAIR0 {.bycopy.} = object
initiator: uint64
responder: uint64
IKEEXT_CREDENTIALS1 {.bycopy.} = object
numCredentials: uint32
credentials: pointer
FWP_BYTE_BLOB {.bycopy.} = object
size: uint32
data: pointer
IKEEXT_SA_DETAILS1 {.bycopy.} = object
saId: uint64
keyModuleType: int32
ipVersion: int32
Anonymous: _Anonymous_e__Union
ikeTraffic: IKEEXT_TRAFFIC0
ikeProposal: IKEEXT_PROPOSAL0
cookiePair: IKEEXT_COOKIE_PAIR0
ikeCredentials: IKEEXT_CREDENTIALS1
ikePolicyKey: GUID
virtualIfTunnelId: uint64
correlationKey: FWP_BYTE_BLOBstruct IKEEXT_TRAFFIC0
{
int ipVersion;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
ulong authIpFilterId;
}
struct IKEEXT_CIPHER_ALGORITHM0
{
int algoIdentifier;
uint keyLen;
uint rounds;
}
struct IKEEXT_INTEGRITY_ALGORITHM0
{
int algoIdentifier;
}
struct IKEEXT_PROPOSAL0
{
IKEEXT_CIPHER_ALGORITHM0 cipherAlgorithm;
IKEEXT_INTEGRITY_ALGORITHM0 integrityAlgorithm;
uint maxLifetimeSeconds;
int dhGroup;
uint quickModeLimit;
}
struct IKEEXT_COOKIE_PAIR0
{
ulong initiator;
ulong responder;
}
struct IKEEXT_CREDENTIALS1
{
uint numCredentials;
void* credentials;
}
struct FWP_BYTE_BLOB
{
uint size;
void* data;
}
struct IKEEXT_SA_DETAILS1
{
ulong saId;
int keyModuleType;
int ipVersion;
_Anonymous_e__Union Anonymous;
IKEEXT_TRAFFIC0 ikeTraffic;
IKEEXT_PROPOSAL0 ikeProposal;
IKEEXT_COOKIE_PAIR0 cookiePair;
IKEEXT_CREDENTIALS1 ikeCredentials;
GUID ikePolicyKey;
ulong virtualIfTunnelId;
FWP_BYTE_BLOB correlationKey;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IKEEXT_SA_DETAILS1 サイズ: 160 バイト(x86)
dim st, 40 ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; saId : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; keyModuleType : IKEEXT_KEY_MODULE_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ipVersion : FWP_IP_VERSION (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ikeTraffic : IKEEXT_TRAFFIC0 (+24, 48byte) varptr(st)+24 を基点に操作(48byte:入れ子/配列)
; ikeProposal : IKEEXT_PROPOSAL0 (+72, 28byte) varptr(st)+72 を基点に操作(28byte:入れ子/配列)
; cookiePair : IKEEXT_COOKIE_PAIR0 (+104, 16byte) varptr(st)+104 を基点に操作(16byte:入れ子/配列)
; ikeCredentials : IKEEXT_CREDENTIALS1 (+120, 8byte) varptr(st)+120 を基点に操作(8byte:入れ子/配列)
; ikePolicyKey : GUID (+128, 16byte) varptr(st)+128 を基点に操作(16byte:入れ子/配列)
; virtualIfTunnelId : ULONGLONG (+144, 8byte) qpoke st,144,値 / qpeek(st,144) ※IronHSPのみ。3.7/3.8は lpoke st,144,下位 : lpoke st,148,上位
; correlationKey : FWP_BYTE_BLOB (+152, 8byte) varptr(st)+152 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IKEEXT_SA_DETAILS1 サイズ: 176 バイト(x64)
dim st, 44 ; 4byte整数×44(構造体サイズ 176 / 4 切り上げ)
; saId : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; keyModuleType : IKEEXT_KEY_MODULE_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ipVersion : FWP_IP_VERSION (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ikeTraffic : IKEEXT_TRAFFIC0 (+24, 48byte) varptr(st)+24 を基点に操作(48byte:入れ子/配列)
; ikeProposal : IKEEXT_PROPOSAL0 (+72, 28byte) varptr(st)+72 を基点に操作(28byte:入れ子/配列)
; cookiePair : IKEEXT_COOKIE_PAIR0 (+104, 16byte) varptr(st)+104 を基点に操作(16byte:入れ子/配列)
; ikeCredentials : IKEEXT_CREDENTIALS1 (+120, 16byte) varptr(st)+120 を基点に操作(16byte:入れ子/配列)
; ikePolicyKey : GUID (+136, 16byte) varptr(st)+136 を基点に操作(16byte:入れ子/配列)
; virtualIfTunnelId : ULONGLONG (+152, 8byte) qpoke st,152,値 / qpeek(st,152) ※IronHSPのみ。3.7/3.8は lpoke st,152,下位 : lpoke st,156,上位
; correlationKey : FWP_BYTE_BLOB (+160, 16byte) varptr(st)+160 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global IKEEXT_TRAFFIC0
#field int ipVersion
#field byte Anonymous1 16
#field byte Anonymous2 16
#field int64 authIpFilterId
#endstruct
#defstruct global IKEEXT_CIPHER_ALGORITHM0
#field int algoIdentifier
#field int keyLen
#field int rounds
#endstruct
#defstruct global IKEEXT_INTEGRITY_ALGORITHM0
#field int algoIdentifier
#endstruct
#defstruct global IKEEXT_PROPOSAL0
#field IKEEXT_CIPHER_ALGORITHM0 cipherAlgorithm
#field IKEEXT_INTEGRITY_ALGORITHM0 integrityAlgorithm
#field int maxLifetimeSeconds
#field int dhGroup
#field int quickModeLimit
#endstruct
#defstruct global IKEEXT_COOKIE_PAIR0
#field int64 initiator
#field int64 responder
#endstruct
#defstruct global IKEEXT_CREDENTIALS1
#field int numCredentials
#field intptr credentials
#endstruct
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global FWP_BYTE_BLOB
#field int size
#field intptr data
#endstruct
#defstruct global IKEEXT_SA_DETAILS1
#field int64 saId
#field int keyModuleType
#field int ipVersion
#field byte Anonymous 8
#field IKEEXT_TRAFFIC0 ikeTraffic
#field IKEEXT_PROPOSAL0 ikeProposal
#field IKEEXT_COOKIE_PAIR0 cookiePair
#field IKEEXT_CREDENTIALS1 ikeCredentials
#field GUID ikePolicyKey
#field int64 virtualIfTunnelId
#field FWP_BYTE_BLOB correlationKey
#endstruct
stdim st, IKEEXT_SA_DETAILS1 ; NSTRUCT 変数を確保
st->saId = 100
mes "saId=" + st->saId
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。