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

EVENT_FILTER_LEVEL_KW

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

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

フィールド

フィールドサイズx64x86説明
MatchAnyKeywordULONGLONG8+0+0いずれか一致で対象とするキーワードビットマスク。
MatchAllKeywordULONGLONG8+8+8全一致を要求するキーワードビットマスク。
LevelBYTE1+16+16対象とするイベントレベル(冗長度)。
FilterInBOOLEAN1+17+17TRUEで許可、FALSEで除外するフィルタモード。

各言語での定義

#include <windows.h>

// EVENT_FILTER_LEVEL_KW  (x64 24 / x86 24 バイト)
typedef struct EVENT_FILTER_LEVEL_KW {
    ULONGLONG MatchAnyKeyword;
    ULONGLONG MatchAllKeyword;
    BYTE Level;
    BOOLEAN FilterIn;
} EVENT_FILTER_LEVEL_KW;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_FILTER_LEVEL_KW
{
    public ulong MatchAnyKeyword;
    public ulong MatchAllKeyword;
    public byte Level;
    [MarshalAs(UnmanagedType.U1)] public bool FilterIn;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_FILTER_LEVEL_KW
    Public MatchAnyKeyword As ULong
    Public MatchAllKeyword As ULong
    Public Level As Byte
    <MarshalAs(UnmanagedType.U1)> Public FilterIn As Boolean
End Structure
import ctypes
from ctypes import wintypes

class EVENT_FILTER_LEVEL_KW(ctypes.Structure):
    _fields_ = [
        ("MatchAnyKeyword", ctypes.c_ulonglong),
        ("MatchAllKeyword", ctypes.c_ulonglong),
        ("Level", ctypes.c_ubyte),
        ("FilterIn", ctypes.c_byte),
    ]
#[repr(C)]
pub struct EVENT_FILTER_LEVEL_KW {
    pub MatchAnyKeyword: u64,
    pub MatchAllKeyword: u64,
    pub Level: u8,
    pub FilterIn: u8,
}
import "golang.org/x/sys/windows"

type EVENT_FILTER_LEVEL_KW struct {
	MatchAnyKeyword uint64
	MatchAllKeyword uint64
	Level byte
	FilterIn byte
}
type
  EVENT_FILTER_LEVEL_KW = record
    MatchAnyKeyword: UInt64;
    MatchAllKeyword: UInt64;
    Level: Byte;
    FilterIn: ByteBool;
  end;
const EVENT_FILTER_LEVEL_KW = extern struct {
    MatchAnyKeyword: u64,
    MatchAllKeyword: u64,
    Level: u8,
    FilterIn: u8,
};
type
  EVENT_FILTER_LEVEL_KW {.bycopy.} = object
    MatchAnyKeyword: uint64
    MatchAllKeyword: uint64
    Level: uint8
    FilterIn: uint8
struct EVENT_FILTER_LEVEL_KW
{
    ulong MatchAnyKeyword;
    ulong MatchAllKeyword;
    ubyte Level;
    ubyte FilterIn;
}

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_LEVEL_KW サイズ: 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)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EVENT_FILTER_LEVEL_KW
    #field int64 MatchAnyKeyword
    #field int64 MatchAllKeyword
    #field byte Level
    #field bool1 FilterIn
#endstruct

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