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

EVENT_FILTER_EVENT_ID

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

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

フィールド

フィールドサイズx64x86説明
FilterInBOOLEAN1+0+0TRUEで指定IDを許可、FALSEで除外するフィルタモード。
ReservedBYTE1+1+1予約フィールド。0であること。
CountWORD2+2+2Events配列に含まれるイベントIDの数。
EventsWORD2+4+4フィルタ対象のイベントID配列の先頭。可変長。

各言語での定義

#include <windows.h>

// EVENT_FILTER_EVENT_ID  (x64 6 / x86 6 バイト)
typedef struct EVENT_FILTER_EVENT_ID {
    BOOLEAN FilterIn;
    BYTE Reserved;
    WORD Count;
    WORD Events[1];
} EVENT_FILTER_EVENT_ID;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_FILTER_EVENT_ID
{
    [MarshalAs(UnmanagedType.U1)] public bool FilterIn;
    public byte Reserved;
    public ushort Count;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public ushort[] Events;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_FILTER_EVENT_ID
    <MarshalAs(UnmanagedType.U1)> Public FilterIn As Boolean
    Public Reserved As Byte
    Public Count As UShort
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Events() As UShort
End Structure
import ctypes
from ctypes import wintypes

class EVENT_FILTER_EVENT_ID(ctypes.Structure):
    _fields_ = [
        ("FilterIn", ctypes.c_byte),
        ("Reserved", ctypes.c_ubyte),
        ("Count", ctypes.c_ushort),
        ("Events", ctypes.c_ushort * 1),
    ]
#[repr(C)]
pub struct EVENT_FILTER_EVENT_ID {
    pub FilterIn: u8,
    pub Reserved: u8,
    pub Count: u16,
    pub Events: [u16; 1],
}
import "golang.org/x/sys/windows"

type EVENT_FILTER_EVENT_ID struct {
	FilterIn byte
	Reserved byte
	Count uint16
	Events [1]uint16
}
type
  EVENT_FILTER_EVENT_ID = record
    FilterIn: ByteBool;
    Reserved: Byte;
    Count: Word;
    Events: array[0..0] of Word;
  end;
const EVENT_FILTER_EVENT_ID = extern struct {
    FilterIn: u8,
    Reserved: u8,
    Count: u16,
    Events: [1]u16,
};
type
  EVENT_FILTER_EVENT_ID {.bycopy.} = object
    FilterIn: uint8
    Reserved: uint8
    Count: uint16
    Events: array[1, uint16]
struct EVENT_FILTER_EVENT_ID
{
    ubyte FilterIn;
    ubyte Reserved;
    ushort Count;
    ushort[1] Events;
}

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_ID サイズ: 6 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 6 / 4 切り上げ)
; FilterIn : BOOLEAN (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; Reserved : BYTE (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; Count : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; Events : WORD (+4, 2byte)  varptr(st)+4 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EVENT_FILTER_EVENT_ID
    #field bool1 FilterIn
    #field byte Reserved
    #field short Count
    #field short Events 1
#endstruct

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