ホーム › System.Diagnostics.Etw › ETW_TRACE_PARTITION_INFORMATION_V2
ETW_TRACE_PARTITION_INFORMATION_V2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| QpcOffsetFromRoot | LONGLONG | 8 | +0 | +0 | ルートパーティションからのQPCオフセット。 |
| PartitionType | DWORD | 4 | +8 | +8 | パーティションの種類を示す値。 |
| PartitionId | LPWSTR | 8/4 | +16 | +12 | パーティション識別子(ワイド文字列)。 |
| ParentId | LPWSTR | 8/4 | +24 | +16 | 親パーティション識別子(ワイド文字列)。 |
各言語での定義
#include <windows.h>
// ETW_TRACE_PARTITION_INFORMATION_V2 (x64 32 / x86 24 バイト)
typedef struct ETW_TRACE_PARTITION_INFORMATION_V2 {
LONGLONG QpcOffsetFromRoot;
DWORD PartitionType;
LPWSTR PartitionId;
LPWSTR ParentId;
} ETW_TRACE_PARTITION_INFORMATION_V2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ETW_TRACE_PARTITION_INFORMATION_V2
{
public long QpcOffsetFromRoot;
public uint PartitionType;
public IntPtr PartitionId;
public IntPtr ParentId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ETW_TRACE_PARTITION_INFORMATION_V2
Public QpcOffsetFromRoot As Long
Public PartitionType As UInteger
Public PartitionId As IntPtr
Public ParentId As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class ETW_TRACE_PARTITION_INFORMATION_V2(ctypes.Structure):
_fields_ = [
("QpcOffsetFromRoot", ctypes.c_longlong),
("PartitionType", wintypes.DWORD),
("PartitionId", ctypes.c_void_p),
("ParentId", ctypes.c_void_p),
]#[repr(C)]
pub struct ETW_TRACE_PARTITION_INFORMATION_V2 {
pub QpcOffsetFromRoot: i64,
pub PartitionType: u32,
pub PartitionId: *mut core::ffi::c_void,
pub ParentId: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type ETW_TRACE_PARTITION_INFORMATION_V2 struct {
QpcOffsetFromRoot int64
PartitionType uint32
PartitionId uintptr
ParentId uintptr
}type
ETW_TRACE_PARTITION_INFORMATION_V2 = record
QpcOffsetFromRoot: Int64;
PartitionType: DWORD;
PartitionId: Pointer;
ParentId: Pointer;
end;const ETW_TRACE_PARTITION_INFORMATION_V2 = extern struct {
QpcOffsetFromRoot: i64,
PartitionType: u32,
PartitionId: ?*anyopaque,
ParentId: ?*anyopaque,
};type
ETW_TRACE_PARTITION_INFORMATION_V2 {.bycopy.} = object
QpcOffsetFromRoot: int64
PartitionType: uint32
PartitionId: pointer
ParentId: pointerstruct ETW_TRACE_PARTITION_INFORMATION_V2
{
long QpcOffsetFromRoot;
uint PartitionType;
void* PartitionId;
void* ParentId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ETW_TRACE_PARTITION_INFORMATION_V2 サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; QpcOffsetFromRoot : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; PartitionType : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PartitionId : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ParentId : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ETW_TRACE_PARTITION_INFORMATION_V2 サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; QpcOffsetFromRoot : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; PartitionType : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PartitionId : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ParentId : LPWSTR (+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 ETW_TRACE_PARTITION_INFORMATION_V2
#field int64 QpcOffsetFromRoot
#field int PartitionType
#field intptr PartitionId
#field intptr ParentId
#endstruct
stdim st, ETW_TRACE_PARTITION_INFORMATION_V2 ; NSTRUCT 変数を確保
st->QpcOffsetFromRoot = 100
mes "QpcOffsetFromRoot=" + st->QpcOffsetFromRoot