Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Etw › EVENT_FILTER_EVENT_NAME

EVENT_FILTER_EVENT_NAME

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

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

フィールド

フィールドサイズx64x86説明
MatchAnyKeywordULONGLONG8+0+0フィルター対象とするイベントのカテゴリを決定するキーワードのビットマスクです。
MatchAllKeywordULONGLONG8+8+8このビットマスクは省略可能です。このマスクは、フィルター対象とするイベントのカテゴリを さらに制限します。イベントのキーワードが MatchAnyKeyword の条件を満たす場合、 プロバイダーは、このマスクのすべてのビットがイベントのキーワードに存在する場合にのみ そのイベントをフィルターします。MatchAnyKeyword が 0 の場合、このマスクは使用されません。
LevelBYTE1+16+16フィルター対象とするイベントの重大度レベルを定義します。
FilterInBOOLEAN1+17+17

指定された名前に一致するイベントをフィルターインする (対象に含める) 場合は True、 フィルターアウトする (対象から除外する) 場合は false です。

EVENT_FILTER_TYPE_STACKWALK_NAMEフィルタータイプで使用した場合、フィルターインされた イベントについてスタックが収集されます。

NameCountWORD2+18+18Names メンバー内の名前の数です。
NamesBYTE1+20+20NameCount 個の要素を持つ、null 終端 UTF-8 イベント名の配列です。

公式ドキュメント

EVENT_FILTER_EVENT_NAME 構造体は、イベント名またはスタックウォーク名のフィルター用に EVENT_FILTER_DESCRIPTOR 構造体で使用されるイベント ID を定義します。

このフィルターは、有効化の呼び出しでのレベル/キーワードによってログセッションで 別途有効になっているイベントにのみ適用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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 Structure
import 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