ホーム › System.Diagnostics.Etw › TRACE_ENABLE_INFO
TRACE_ENABLE_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| IsEnabled | DWORD | 4 | +0 | +0 | プロバイダーがセッションに対して有効になっているかどうかを示します。プロバイダーがセッションに対して有効な場合、値は TRUE です。それ以外の場合、値は FALSE です。この値は常に TRUE になります。 |
| Level | BYTE | 1 | +4 | +4 | セッションがプロバイダーに対してイベントへ含めるよう要求した詳細レベルです。 詳細については、 EnableTraceEx 関数の Level パラメーターを参照してください。 |
| Reserved1 | BYTE | 1 | +5 | +5 | 予約済みです。 |
| LoggerId | WORD | 2 | +6 | +6 | プロバイダーを有効にしたセッションを識別します。 |
| EnableProperty | DWORD | 4 | +8 | +8 | セッションが ETW にログファイルへ含めさせたい追加情報です。 詳細については、 EnableTraceEx 関数の EnableProperty パラメーターを参照してください。 |
| Reserved2 | DWORD | 4 | +12 | +12 | 予約済みです。 |
| MatchAnyKeyword | ULONGLONG | 8 | +16 | +16 | キーワードは、セッションがプロバイダーに書き込ませたいイベントを指定します。 詳細については、 EnableTraceEx 関数の MatchAnyKeyword パラメーターを参照してください。 |
| MatchAllKeyword | ULONGLONG | 8 | +24 | +24 | キーワードは、セッションがプロバイダーに書き込ませたいイベントを指定します。 詳細については、 EnableTraceEx 関数の MatchAllKeyword パラメーターを参照してください。 |
公式ドキュメント
セッションと、そのセッションがプロバイダーを有効にするために使用した情報を定義します。 この情報は、 EnumerateTraceGuidsEx によって TRACE_PROVIDER_INSTANCE_INFO ブロックの一部として返されます。
解説(Remarks)
TRACE_PROVIDER_INSTANCE_INFO ブロックには、この構造体が 1 つ以上含まれます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// TRACE_ENABLE_INFO (x64 32 / x86 32 バイト)
typedef struct TRACE_ENABLE_INFO {
DWORD IsEnabled;
BYTE Level;
BYTE Reserved1;
WORD LoggerId;
DWORD EnableProperty;
DWORD Reserved2;
ULONGLONG MatchAnyKeyword;
ULONGLONG MatchAllKeyword;
} TRACE_ENABLE_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRACE_ENABLE_INFO
{
public uint IsEnabled;
public byte Level;
public byte Reserved1;
public ushort LoggerId;
public uint EnableProperty;
public uint Reserved2;
public ulong MatchAnyKeyword;
public ulong MatchAllKeyword;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRACE_ENABLE_INFO
Public IsEnabled As UInteger
Public Level As Byte
Public Reserved1 As Byte
Public LoggerId As UShort
Public EnableProperty As UInteger
Public Reserved2 As UInteger
Public MatchAnyKeyword As ULong
Public MatchAllKeyword As ULong
End Structureimport ctypes
from ctypes import wintypes
class TRACE_ENABLE_INFO(ctypes.Structure):
_fields_ = [
("IsEnabled", wintypes.DWORD),
("Level", ctypes.c_ubyte),
("Reserved1", ctypes.c_ubyte),
("LoggerId", ctypes.c_ushort),
("EnableProperty", wintypes.DWORD),
("Reserved2", wintypes.DWORD),
("MatchAnyKeyword", ctypes.c_ulonglong),
("MatchAllKeyword", ctypes.c_ulonglong),
]#[repr(C)]
pub struct TRACE_ENABLE_INFO {
pub IsEnabled: u32,
pub Level: u8,
pub Reserved1: u8,
pub LoggerId: u16,
pub EnableProperty: u32,
pub Reserved2: u32,
pub MatchAnyKeyword: u64,
pub MatchAllKeyword: u64,
}import "golang.org/x/sys/windows"
type TRACE_ENABLE_INFO struct {
IsEnabled uint32
Level byte
Reserved1 byte
LoggerId uint16
EnableProperty uint32
Reserved2 uint32
MatchAnyKeyword uint64
MatchAllKeyword uint64
}type
TRACE_ENABLE_INFO = record
IsEnabled: DWORD;
Level: Byte;
Reserved1: Byte;
LoggerId: Word;
EnableProperty: DWORD;
Reserved2: DWORD;
MatchAnyKeyword: UInt64;
MatchAllKeyword: UInt64;
end;const TRACE_ENABLE_INFO = extern struct {
IsEnabled: u32,
Level: u8,
Reserved1: u8,
LoggerId: u16,
EnableProperty: u32,
Reserved2: u32,
MatchAnyKeyword: u64,
MatchAllKeyword: u64,
};type
TRACE_ENABLE_INFO {.bycopy.} = object
IsEnabled: uint32
Level: uint8
Reserved1: uint8
LoggerId: uint16
EnableProperty: uint32
Reserved2: uint32
MatchAnyKeyword: uint64
MatchAllKeyword: uint64struct TRACE_ENABLE_INFO
{
uint IsEnabled;
ubyte Level;
ubyte Reserved1;
ushort LoggerId;
uint EnableProperty;
uint Reserved2;
ulong MatchAnyKeyword;
ulong MatchAllKeyword;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRACE_ENABLE_INFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; IsEnabled : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Level : BYTE (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; Reserved1 : BYTE (+5, 1byte) poke st,5,値 / 値 = peek(st,5)
; LoggerId : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; EnableProperty : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Reserved2 : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MatchAnyKeyword : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; MatchAllKeyword : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TRACE_ENABLE_INFO
#field int IsEnabled
#field byte Level
#field byte Reserved1
#field short LoggerId
#field int EnableProperty
#field int Reserved2
#field int64 MatchAnyKeyword
#field int64 MatchAllKeyword
#endstruct
stdim st, TRACE_ENABLE_INFO ; NSTRUCT 変数を確保
st->IsEnabled = 100
mes "IsEnabled=" + st->IsEnabled