ホーム › NetworkManagement.WindowsFilteringPlatform › FWPM_CALLOUT_CHANGE0
FWPM_CALLOUT_CHANGE0
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| changeType | FWPM_CHANGE_TYPE | 4 | +0 | +0 | 発生した変更の種類(追加/削除など)を示す列挙値。 |
| calloutKey | GUID | 16 | +4 | +4 | 変更が発生したコールアウトのGUID。 |
| calloutId | DWORD | 4 | +20 | +20 | 変更が発生したコールアウトの実行時ID。 |
各言語での定義
#include <windows.h>
// FWPM_CALLOUT_CHANGE0 (x64 24 / x86 24 バイト)
typedef struct FWPM_CALLOUT_CHANGE0 {
FWPM_CHANGE_TYPE changeType;
GUID calloutKey;
DWORD calloutId;
} FWPM_CALLOUT_CHANGE0;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FWPM_CALLOUT_CHANGE0
{
public int changeType;
public Guid calloutKey;
public uint calloutId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FWPM_CALLOUT_CHANGE0
Public changeType As Integer
Public calloutKey As Guid
Public calloutId As UInteger
End Structureimport ctypes
from ctypes import wintypes
class FWPM_CALLOUT_CHANGE0(ctypes.Structure):
_fields_ = [
("changeType", ctypes.c_int),
("calloutKey", GUID),
("calloutId", wintypes.DWORD),
]#[repr(C)]
pub struct FWPM_CALLOUT_CHANGE0 {
pub changeType: i32,
pub calloutKey: GUID,
pub calloutId: u32,
}import "golang.org/x/sys/windows"
type FWPM_CALLOUT_CHANGE0 struct {
changeType int32
calloutKey windows.GUID
calloutId uint32
}type
FWPM_CALLOUT_CHANGE0 = record
changeType: Integer;
calloutKey: TGUID;
calloutId: DWORD;
end;const FWPM_CALLOUT_CHANGE0 = extern struct {
changeType: i32,
calloutKey: GUID,
calloutId: u32,
};type
FWPM_CALLOUT_CHANGE0 {.bycopy.} = object
changeType: int32
calloutKey: GUID
calloutId: uint32struct FWPM_CALLOUT_CHANGE0
{
int changeType;
GUID calloutKey;
uint calloutId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FWPM_CALLOUT_CHANGE0 サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; changeType : FWPM_CHANGE_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; calloutKey : GUID (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; calloutId : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (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 FWPM_CALLOUT_CHANGE0
#field int changeType
#field GUID calloutKey
#field int calloutId
#endstruct
stdim st, FWPM_CALLOUT_CHANGE0 ; NSTRUCT 変数を確保
st->changeType = 100
mes "changeType=" + st->changeType