ホーム › System.Diagnostics.Etw › EVENT_MAP_ENTRY
EVENT_MAP_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OutputOffset | DWORD | 4 | +0 | +0 | 出力文字列(マップ値の名称)へのバイトオフセット。 |
| Anonymous | _Anonymous_e__Union | 4 | +4 | +4 | 数値マップ値またはInputOffsetを含む共用体。 |
共用体: _Anonymous_e__Union x64 4B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Value | DWORD | 4 | +0 | +0 |
| InputOffset | DWORD | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// EVENT_MAP_ENTRY (x64 8 / x86 8 バイト)
typedef struct EVENT_MAP_ENTRY {
DWORD OutputOffset;
_Anonymous_e__Union Anonymous;
} EVENT_MAP_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_MAP_ENTRY
{
public uint OutputOffset;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_MAP_ENTRY
Public OutputOffset As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class EVENT_MAP_ENTRY(ctypes.Structure):
_fields_ = [
("OutputOffset", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct EVENT_MAP_ENTRY {
pub OutputOffset: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type EVENT_MAP_ENTRY struct {
OutputOffset uint32
Anonymous _Anonymous_e__Union
}type
EVENT_MAP_ENTRY = record
OutputOffset: DWORD;
Anonymous: _Anonymous_e__Union;
end;const EVENT_MAP_ENTRY = extern struct {
OutputOffset: u32,
Anonymous: _Anonymous_e__Union,
};type
EVENT_MAP_ENTRY {.bycopy.} = object
OutputOffset: uint32
Anonymous: _Anonymous_e__Unionstruct EVENT_MAP_ENTRY
{
uint OutputOffset;
_Anonymous_e__Union Anonymous;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EVENT_MAP_ENTRY サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; OutputOffset : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EVENT_MAP_ENTRY
#field int OutputOffset
#field byte Anonymous 4
#endstruct
stdim st, EVENT_MAP_ENTRY ; NSTRUCT 変数を確保
st->OutputOffset = 100
mes "OutputOffset=" + st->OutputOffset
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。