ホーム › System.Diagnostics.Etw › EVENT_EXTENDED_ITEM_INSTANCE
EVENT_EXTENDED_ITEM_INSTANCE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| InstanceId | DWORD | 4 | +0 | +0 | イベントインスタンスの識別子。 |
| ParentInstanceId | DWORD | 4 | +4 | +4 | 親イベントインスタンスの識別子。 |
| ParentGuid | GUID | 16 | +8 | +8 | 親イベントを識別するGUID。 |
各言語での定義
#include <windows.h>
// EVENT_EXTENDED_ITEM_INSTANCE (x64 24 / x86 24 バイト)
typedef struct EVENT_EXTENDED_ITEM_INSTANCE {
DWORD InstanceId;
DWORD ParentInstanceId;
GUID ParentGuid;
} EVENT_EXTENDED_ITEM_INSTANCE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_EXTENDED_ITEM_INSTANCE
{
public uint InstanceId;
public uint ParentInstanceId;
public Guid ParentGuid;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_EXTENDED_ITEM_INSTANCE
Public InstanceId As UInteger
Public ParentInstanceId As UInteger
Public ParentGuid As Guid
End Structureimport ctypes
from ctypes import wintypes
class EVENT_EXTENDED_ITEM_INSTANCE(ctypes.Structure):
_fields_ = [
("InstanceId", wintypes.DWORD),
("ParentInstanceId", wintypes.DWORD),
("ParentGuid", GUID),
]#[repr(C)]
pub struct EVENT_EXTENDED_ITEM_INSTANCE {
pub InstanceId: u32,
pub ParentInstanceId: u32,
pub ParentGuid: GUID,
}import "golang.org/x/sys/windows"
type EVENT_EXTENDED_ITEM_INSTANCE struct {
InstanceId uint32
ParentInstanceId uint32
ParentGuid windows.GUID
}type
EVENT_EXTENDED_ITEM_INSTANCE = record
InstanceId: DWORD;
ParentInstanceId: DWORD;
ParentGuid: TGUID;
end;const EVENT_EXTENDED_ITEM_INSTANCE = extern struct {
InstanceId: u32,
ParentInstanceId: u32,
ParentGuid: GUID,
};type
EVENT_EXTENDED_ITEM_INSTANCE {.bycopy.} = object
InstanceId: uint32
ParentInstanceId: uint32
ParentGuid: GUIDstruct EVENT_EXTENDED_ITEM_INSTANCE
{
uint InstanceId;
uint ParentInstanceId;
GUID ParentGuid;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EVENT_EXTENDED_ITEM_INSTANCE サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; InstanceId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ParentInstanceId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ParentGuid : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global EVENT_EXTENDED_ITEM_INSTANCE
#field int InstanceId
#field int ParentInstanceId
#field GUID ParentGuid
#endstruct
stdim st, EVENT_EXTENDED_ITEM_INSTANCE ; NSTRUCT 変数を確保
st->InstanceId = 100
mes "InstanceId=" + st->InstanceId