ホーム › System.Diagnostics.Etw › EVENT_FILTER_EVENT_NAME
EVENT_FILTER_EVENT_NAME
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| MatchAnyKeyword | ULONGLONG | 8 | +0 | +0 | いずれか一致で対象とするキーワードビットマスク。 |
| MatchAllKeyword | ULONGLONG | 8 | +8 | +8 | 全一致を要求するキーワードビットマスク。 |
| Level | BYTE | 1 | +16 | +16 | 対象とするイベントレベル(冗長度)。 |
| FilterIn | BOOLEAN | 1 | +17 | +17 | TRUEで許可、FALSEで除外するフィルタモード。 |
| NameCount | WORD | 2 | +18 | +18 | Names内のイベント名の数。 |
| Names | BYTE | 1 | +20 | +20 | NULL区切りのイベント名群の先頭バイト。可変長。 |
各言語での定義
#include <windows.h>
// EVENT_FILTER_EVENT_NAME (x64 24 / x86 24 バイト)
typedef struct EVENT_FILTER_EVENT_NAME {
ULONGLONG MatchAnyKeyword;
ULONGLONG MatchAllKeyword;
BYTE Level;
BOOLEAN FilterIn;
WORD NameCount;
BYTE Names[1];
} EVENT_FILTER_EVENT_NAME;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_FILTER_EVENT_NAME
{
public ulong MatchAnyKeyword;
public ulong MatchAllKeyword;
public byte Level;
[MarshalAs(UnmanagedType.U1)] public bool FilterIn;
public ushort NameCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Names;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_FILTER_EVENT_NAME
Public MatchAnyKeyword As ULong
Public MatchAllKeyword As ULong
Public Level As Byte
<MarshalAs(UnmanagedType.U1)> Public FilterIn As Boolean
Public NameCount As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Names() As Byte
End Structureimport ctypes
from ctypes import wintypes
class EVENT_FILTER_EVENT_NAME(ctypes.Structure):
_fields_ = [
("MatchAnyKeyword", ctypes.c_ulonglong),
("MatchAllKeyword", ctypes.c_ulonglong),
("Level", ctypes.c_ubyte),
("FilterIn", ctypes.c_byte),
("NameCount", ctypes.c_ushort),
("Names", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct EVENT_FILTER_EVENT_NAME {
pub MatchAnyKeyword: u64,
pub MatchAllKeyword: u64,
pub Level: u8,
pub FilterIn: u8,
pub NameCount: u16,
pub Names: [u8; 1],
}import "golang.org/x/sys/windows"
type EVENT_FILTER_EVENT_NAME struct {
MatchAnyKeyword uint64
MatchAllKeyword uint64
Level byte
FilterIn byte
NameCount uint16
Names [1]byte
}type
EVENT_FILTER_EVENT_NAME = record
MatchAnyKeyword: UInt64;
MatchAllKeyword: UInt64;
Level: Byte;
FilterIn: ByteBool;
NameCount: Word;
Names: array[0..0] of Byte;
end;const EVENT_FILTER_EVENT_NAME = extern struct {
MatchAnyKeyword: u64,
MatchAllKeyword: u64,
Level: u8,
FilterIn: u8,
NameCount: u16,
Names: [1]u8,
};type
EVENT_FILTER_EVENT_NAME {.bycopy.} = object
MatchAnyKeyword: uint64
MatchAllKeyword: uint64
Level: uint8
FilterIn: uint8
NameCount: uint16
Names: array[1, uint8]struct EVENT_FILTER_EVENT_NAME
{
ulong MatchAnyKeyword;
ulong MatchAllKeyword;
ubyte Level;
ubyte FilterIn;
ushort NameCount;
ubyte[1] Names;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EVENT_FILTER_EVENT_NAME サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; MatchAnyKeyword : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MatchAllKeyword : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Level : BYTE (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; FilterIn : BOOLEAN (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; NameCount : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; Names : BYTE (+20, 1byte) varptr(st)+20 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EVENT_FILTER_EVENT_NAME
#field int64 MatchAnyKeyword
#field int64 MatchAllKeyword
#field byte Level
#field bool1 FilterIn
#field short NameCount
#field byte Names 1
#endstruct
stdim st, EVENT_FILTER_EVENT_NAME ; NSTRUCT 変数を確保
st->MatchAnyKeyword = 100
mes "MatchAnyKeyword=" + st->MatchAnyKeyword