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

IKEEXT_POLICY1

構造体
サイズx64: 48 バイト / x86: 36 バイト

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

フィールド

フィールドサイズx64x86説明
softExpirationTimeDWORD4+0+0SAのソフト有効期限(秒単位)。再ネゴシエーションの目安。
numAuthenticationMethodsDWORD4+4+4authenticationMethods配列の要素数。
authenticationMethodsIKEEXT_AUTHENTICATION_METHOD1*8/4+8+8許容する認証方式の配列へのポインター。
initiatorImpersonationTypeIKEEXT_AUTHENTICATION_IMPERSONATION_TYPE4+16+12イニシエーターの偽装種別を示す列挙値。
numIkeProposalsDWORD4+20+16ikeProposals配列の要素数。
ikeProposalsIKEEXT_PROPOSAL0*8/4+24+20IKEプロポーザルの配列へのポインター。
flagsIKEEXT_POLICY_FLAG4+32+24IKEポリシーの動作を制御するフラグ。
maxDynamicFiltersDWORD4+36+28動的に作成可能なフィルターの上限数。
retransmitDurationSecsDWORD4+40+32再送を継続する最大時間(秒単位)。

各言語での定義

#include <windows.h>

// IKEEXT_POLICY1  (x64 48 / x86 36 バイト)
typedef struct IKEEXT_POLICY1 {
    DWORD softExpirationTime;
    DWORD numAuthenticationMethods;
    IKEEXT_AUTHENTICATION_METHOD1* authenticationMethods;
    IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE initiatorImpersonationType;
    DWORD numIkeProposals;
    IKEEXT_PROPOSAL0* ikeProposals;
    IKEEXT_POLICY_FLAG flags;
    DWORD maxDynamicFilters;
    DWORD retransmitDurationSecs;
} IKEEXT_POLICY1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_POLICY1
{
    public uint softExpirationTime;
    public uint numAuthenticationMethods;
    public IntPtr authenticationMethods;
    public int initiatorImpersonationType;
    public uint numIkeProposals;
    public IntPtr ikeProposals;
    public uint flags;
    public uint maxDynamicFilters;
    public uint retransmitDurationSecs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_POLICY1
    Public softExpirationTime As UInteger
    Public numAuthenticationMethods As UInteger
    Public authenticationMethods As IntPtr
    Public initiatorImpersonationType As Integer
    Public numIkeProposals As UInteger
    Public ikeProposals As IntPtr
    Public flags As UInteger
    Public maxDynamicFilters As UInteger
    Public retransmitDurationSecs As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IKEEXT_POLICY1(ctypes.Structure):
    _fields_ = [
        ("softExpirationTime", wintypes.DWORD),
        ("numAuthenticationMethods", wintypes.DWORD),
        ("authenticationMethods", ctypes.c_void_p),
        ("initiatorImpersonationType", ctypes.c_int),
        ("numIkeProposals", wintypes.DWORD),
        ("ikeProposals", ctypes.c_void_p),
        ("flags", wintypes.DWORD),
        ("maxDynamicFilters", wintypes.DWORD),
        ("retransmitDurationSecs", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IKEEXT_POLICY1 {
    pub softExpirationTime: u32,
    pub numAuthenticationMethods: u32,
    pub authenticationMethods: *mut core::ffi::c_void,
    pub initiatorImpersonationType: i32,
    pub numIkeProposals: u32,
    pub ikeProposals: *mut core::ffi::c_void,
    pub flags: u32,
    pub maxDynamicFilters: u32,
    pub retransmitDurationSecs: u32,
}
import "golang.org/x/sys/windows"

type IKEEXT_POLICY1 struct {
	softExpirationTime uint32
	numAuthenticationMethods uint32
	authenticationMethods uintptr
	initiatorImpersonationType int32
	numIkeProposals uint32
	ikeProposals uintptr
	flags uint32
	maxDynamicFilters uint32
	retransmitDurationSecs uint32
}
type
  IKEEXT_POLICY1 = record
    softExpirationTime: DWORD;
    numAuthenticationMethods: DWORD;
    authenticationMethods: Pointer;
    initiatorImpersonationType: Integer;
    numIkeProposals: DWORD;
    ikeProposals: Pointer;
    flags: DWORD;
    maxDynamicFilters: DWORD;
    retransmitDurationSecs: DWORD;
  end;
const IKEEXT_POLICY1 = extern struct {
    softExpirationTime: u32,
    numAuthenticationMethods: u32,
    authenticationMethods: ?*anyopaque,
    initiatorImpersonationType: i32,
    numIkeProposals: u32,
    ikeProposals: ?*anyopaque,
    flags: u32,
    maxDynamicFilters: u32,
    retransmitDurationSecs: u32,
};
type
  IKEEXT_POLICY1 {.bycopy.} = object
    softExpirationTime: uint32
    numAuthenticationMethods: uint32
    authenticationMethods: pointer
    initiatorImpersonationType: int32
    numIkeProposals: uint32
    ikeProposals: pointer
    flags: uint32
    maxDynamicFilters: uint32
    retransmitDurationSecs: uint32
struct IKEEXT_POLICY1
{
    uint softExpirationTime;
    uint numAuthenticationMethods;
    void* authenticationMethods;
    int initiatorImpersonationType;
    uint numIkeProposals;
    void* ikeProposals;
    uint flags;
    uint maxDynamicFilters;
    uint retransmitDurationSecs;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IKEEXT_POLICY1 サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; softExpirationTime : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; numAuthenticationMethods : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; authenticationMethods : IKEEXT_AUTHENTICATION_METHOD1* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; initiatorImpersonationType : IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; numIkeProposals : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ikeProposals : IKEEXT_PROPOSAL0* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; flags : IKEEXT_POLICY_FLAG (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; maxDynamicFilters : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; retransmitDurationSecs : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IKEEXT_POLICY1 サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; softExpirationTime : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; numAuthenticationMethods : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; authenticationMethods : IKEEXT_AUTHENTICATION_METHOD1* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; initiatorImpersonationType : IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; numIkeProposals : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ikeProposals : IKEEXT_PROPOSAL0* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; flags : IKEEXT_POLICY_FLAG (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; maxDynamicFilters : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; retransmitDurationSecs : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IKEEXT_POLICY1
    #field int softExpirationTime
    #field int numAuthenticationMethods
    #field intptr authenticationMethods
    #field int initiatorImpersonationType
    #field int numIkeProposals
    #field intptr ikeProposals
    #field int flags
    #field int maxDynamicFilters
    #field int retransmitDurationSecs
#endstruct

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