TRACE_LOGFILE_HEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| BufferSize | DWORD | 4 | +0 | +0 | イベント トレース セッションのバッファーのサイズ (バイト単位)。 |
| Anonymous1 | _Anonymous1_e__Union | 8/4 | +8 | +4 | OS バージョン情報を保持する無名共用体。 |
| ProviderVersion | DWORD | 4 | +16 | +8 | トレースが収集されたオペレーティング システムのビルド番号。 |
| NumberOfProcessors | DWORD | 4 | +20 | +12 | トレースが収集されたシステムのプロセッサ数。 |
| EndTime | LONGLONG | 8 | +24 | +16 | イベント トレース セッションが停止した時刻。1601 年 1 月 1 日午前 0 時からの 100 ナノ秒間隔で表されます。リアルタイムでイベントを受信している場合や、確定されていない (適切に閉じられていない) ログ ファイルから読み取っている場合、この値は 0 になることがあります。 |
| TimerResolution | DWORD | 4 | +32 | +24 | ハードウェア タイマーの分解能 (100 ナノ秒単位)。使用方法については、EVENT_TRACE_HEADER の「解説」を参照してください。 |
| MaximumFileSize | DWORD | 4 | +36 | +28 | ログ ファイルの最大サイズ (メガバイト単位)。 |
| LogFileMode | DWORD | 4 | +40 | +32 | イベント トレース セッションのログ モード。値の一覧については、Logging Mode Constants を参照してください。 |
| BuffersWritten | DWORD | 4 | +44 | +36 | イベント トレース セッションによって書き込まれたバッファーの総数。 |
| Anonymous2 | _Anonymous2_e__Union | 16 | +48 | +40 | ログファイルのバージョンや GUID を保持する無名共用体。 |
| LoggerName | LPWSTR | 8/4 | +64 | +56 | このフィールドは使用しないでください。 イベント トレース セッションの名前は、メモリ上でこの構造体に続く最初の NULL 終端文字列です。 |
| LogFileName | LPWSTR | 8/4 | +72 | +60 | このフィールドは使用しないでください。 イベント トレース ログ ファイルの名前は、メモリ上でこの構造体に続く 2 番目の NULL 終端文字列です。最初の文字列はセッションの名前です。 |
| TimeZone | TIME_ZONE_INFORMATION | 172 | +80 | +64 | BootTime、EndTime、StartTime の各メンバーのタイム ゾーンを格納する TIME_ZONE_INFORMATION 構造体。 |
| BootTime | LONGLONG | 8 | +256 | +240 | システムが起動した時刻。1601 年 1 月 1 日午前 0 時からの 100 ナノ秒間隔で表されます。BootTime は、Global Logger セッションに書き込まれたトレースでのみサポートされます。 |
| PerfFreq | LONGLONG | 8 | +264 | +248 | 高分解能パフォーマンス カウンターが存在する場合の、その周波数。 |
| StartTime | LONGLONG | 8 | +272 | +256 | イベント トレース セッションが開始された時刻。1601 年 1 月 1 日午前 0 時からの 100 ナノ秒間隔で表されます。 |
| ReservedFlags | DWORD | 4 | +280 | +264 | クロックの種類を指定します。詳細については、WNODE_HEADER の ClientContext メンバーを参照してください。 |
| BuffersLost | DWORD | 4 | +284 | +268 | イベント トレース セッション中に失われたバッファーの総数。 |
共用体: _Anonymous1_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | トレースが収集されたオペレーティング システムのバージョン番号。これは VersionDetail の各メンバーをまとめたものです。下位バイトから順に、最初の 2 バイトが MajorVersion、次の 2 バイトが MinorVersion、次の 2 バイトが SubVersion、最後の 2 バイトが SubMinorVersion を格納します。 |
| VersionDetail | _VersionDetail_e__Struct | 8/4 | +0 | +0 |
共用体: _Anonymous2_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| LogInstanceGuid | GUID | 16 | +0 | +0 | 予約済みです。 |
| Anonymous | _Anonymous_e__Struct | 8/4 | +0 | +0 |
公式ドキュメント
TRACE_LOGFILE_HEADER 構造体は、イベント トレース セッションとそのイベントに関する情報を格納します。これは、ETW ログ ファイルのヘッダーに含まれるトレース情報データの生のデータ形式です。また、OpenTrace が返す情報の一部でもあり、トレース処理中に BufferCallback に渡されます。
解説(Remarks)
メンバーを設定する前に、必ずこの構造体のメモリを 0 に初期化してください。
ログ ファイルの最初のイベントには、この構造体で定義されたデータが格納されます。このデータにアクセスするには、この構造体を使用するか、EventTrace_Header MOF クラスを使用してイベント データをデコードします。ログ ファイルを生成したコンピューターとは異なるコンピューターでコンシューマーが実行されている場合や、64 ビット コンピューター上の WOW (32 ビット) セッションでログ ファイルが書き込まれた場合、この構造体を使用してイベント データを読み取ると予期しない結果になることがあります。これは、LoggerName メンバーと LogFileName メンバーがポインターであり、PointerSize メンバーによってサイズが変わるためです。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
// TIME_ZONE_INFORMATION (x64 172 / x86 172 バイト)
typedef struct TIME_ZONE_INFORMATION {
INT Bias;
WCHAR StandardName[32];
SYSTEMTIME StandardDate;
INT StandardBias;
WCHAR DaylightName[32];
SYSTEMTIME DaylightDate;
INT DaylightBias;
} TIME_ZONE_INFORMATION;
// TRACE_LOGFILE_HEADER (x64 288 / x86 272 バイト)
typedef struct TRACE_LOGFILE_HEADER {
DWORD BufferSize;
_Anonymous1_e__Union Anonymous1;
DWORD ProviderVersion;
DWORD NumberOfProcessors;
LONGLONG EndTime;
DWORD TimerResolution;
DWORD MaximumFileSize;
DWORD LogFileMode;
DWORD BuffersWritten;
_Anonymous2_e__Union Anonymous2;
LPWSTR LoggerName;
LPWSTR LogFileName;
TIME_ZONE_INFORMATION TimeZone;
LONGLONG BootTime;
LONGLONG PerfFreq;
LONGLONG StartTime;
DWORD ReservedFlags;
DWORD BuffersLost;
} TRACE_LOGFILE_HEADER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TIME_ZONE_INFORMATION
{
public int Bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string StandardName;
public SYSTEMTIME StandardDate;
public int StandardBias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string DaylightName;
public SYSTEMTIME DaylightDate;
public int DaylightBias;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRACE_LOGFILE_HEADER
{
public uint BufferSize;
public _Anonymous1_e__Union Anonymous1;
public uint ProviderVersion;
public uint NumberOfProcessors;
public long EndTime;
public uint TimerResolution;
public uint MaximumFileSize;
public uint LogFileMode;
public uint BuffersWritten;
public _Anonymous2_e__Union Anonymous2;
public IntPtr LoggerName;
public IntPtr LogFileName;
public TIME_ZONE_INFORMATION TimeZone;
public long BootTime;
public long PerfFreq;
public long StartTime;
public uint ReservedFlags;
public uint BuffersLost;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TIME_ZONE_INFORMATION
Public Bias As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public StandardName As String
Public StandardDate As SYSTEMTIME
Public StandardBias As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public DaylightName As String
Public DaylightDate As SYSTEMTIME
Public DaylightBias As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRACE_LOGFILE_HEADER
Public BufferSize As UInteger
Public Anonymous1 As _Anonymous1_e__Union
Public ProviderVersion As UInteger
Public NumberOfProcessors As UInteger
Public EndTime As Long
Public TimerResolution As UInteger
Public MaximumFileSize As UInteger
Public LogFileMode As UInteger
Public BuffersWritten As UInteger
Public Anonymous2 As _Anonymous2_e__Union
Public LoggerName As IntPtr
Public LogFileName As IntPtr
Public TimeZone As TIME_ZONE_INFORMATION
Public BootTime As Long
Public PerfFreq As Long
Public StartTime As Long
Public ReservedFlags As UInteger
Public BuffersLost As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]
class TIME_ZONE_INFORMATION(ctypes.Structure):
_fields_ = [
("Bias", ctypes.c_int),
("StandardName", ctypes.c_wchar * 32),
("StandardDate", SYSTEMTIME),
("StandardBias", ctypes.c_int),
("DaylightName", ctypes.c_wchar * 32),
("DaylightDate", SYSTEMTIME),
("DaylightBias", ctypes.c_int),
]
class TRACE_LOGFILE_HEADER(ctypes.Structure):
_fields_ = [
("BufferSize", wintypes.DWORD),
("Anonymous1", _Anonymous1_e__Union),
("ProviderVersion", wintypes.DWORD),
("NumberOfProcessors", wintypes.DWORD),
("EndTime", ctypes.c_longlong),
("TimerResolution", wintypes.DWORD),
("MaximumFileSize", wintypes.DWORD),
("LogFileMode", wintypes.DWORD),
("BuffersWritten", wintypes.DWORD),
("Anonymous2", _Anonymous2_e__Union),
("LoggerName", ctypes.c_void_p),
("LogFileName", ctypes.c_void_p),
("TimeZone", TIME_ZONE_INFORMATION),
("BootTime", ctypes.c_longlong),
("PerfFreq", ctypes.c_longlong),
("StartTime", ctypes.c_longlong),
("ReservedFlags", wintypes.DWORD),
("BuffersLost", wintypes.DWORD),
]#[repr(C)]
pub struct SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}
#[repr(C)]
pub struct TIME_ZONE_INFORMATION {
pub Bias: i32,
pub StandardName: [u16; 32],
pub StandardDate: SYSTEMTIME,
pub StandardBias: i32,
pub DaylightName: [u16; 32],
pub DaylightDate: SYSTEMTIME,
pub DaylightBias: i32,
}
#[repr(C)]
pub struct TRACE_LOGFILE_HEADER {
pub BufferSize: u32,
pub Anonymous1: _Anonymous1_e__Union,
pub ProviderVersion: u32,
pub NumberOfProcessors: u32,
pub EndTime: i64,
pub TimerResolution: u32,
pub MaximumFileSize: u32,
pub LogFileMode: u32,
pub BuffersWritten: u32,
pub Anonymous2: _Anonymous2_e__Union,
pub LoggerName: *mut core::ffi::c_void,
pub LogFileName: *mut core::ffi::c_void,
pub TimeZone: TIME_ZONE_INFORMATION,
pub BootTime: i64,
pub PerfFreq: i64,
pub StartTime: i64,
pub ReservedFlags: u32,
pub BuffersLost: u32,
}import "golang.org/x/sys/windows"
type SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}
type TIME_ZONE_INFORMATION struct {
Bias int32
StandardName [32]uint16
StandardDate SYSTEMTIME
StandardBias int32
DaylightName [32]uint16
DaylightDate SYSTEMTIME
DaylightBias int32
}
type TRACE_LOGFILE_HEADER struct {
BufferSize uint32
Anonymous1 _Anonymous1_e__Union
ProviderVersion uint32
NumberOfProcessors uint32
EndTime int64
TimerResolution uint32
MaximumFileSize uint32
LogFileMode uint32
BuffersWritten uint32
Anonymous2 _Anonymous2_e__Union
LoggerName uintptr
LogFileName uintptr
TimeZone TIME_ZONE_INFORMATION
BootTime int64
PerfFreq int64
StartTime int64
ReservedFlags uint32
BuffersLost uint32
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
TIME_ZONE_INFORMATION = record
Bias: Integer;
StandardName: array[0..31] of WideChar;
StandardDate: SYSTEMTIME;
StandardBias: Integer;
DaylightName: array[0..31] of WideChar;
DaylightDate: SYSTEMTIME;
DaylightBias: Integer;
end;
TRACE_LOGFILE_HEADER = record
BufferSize: DWORD;
Anonymous1: _Anonymous1_e__Union;
ProviderVersion: DWORD;
NumberOfProcessors: DWORD;
EndTime: Int64;
TimerResolution: DWORD;
MaximumFileSize: DWORD;
LogFileMode: DWORD;
BuffersWritten: DWORD;
Anonymous2: _Anonymous2_e__Union;
LoggerName: Pointer;
LogFileName: Pointer;
TimeZone: TIME_ZONE_INFORMATION;
BootTime: Int64;
PerfFreq: Int64;
StartTime: Int64;
ReservedFlags: DWORD;
BuffersLost: DWORD;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const TIME_ZONE_INFORMATION = extern struct {
Bias: i32,
StandardName: [32]u16,
StandardDate: SYSTEMTIME,
StandardBias: i32,
DaylightName: [32]u16,
DaylightDate: SYSTEMTIME,
DaylightBias: i32,
};
const TRACE_LOGFILE_HEADER = extern struct {
BufferSize: u32,
Anonymous1: _Anonymous1_e__Union,
ProviderVersion: u32,
NumberOfProcessors: u32,
EndTime: i64,
TimerResolution: u32,
MaximumFileSize: u32,
LogFileMode: u32,
BuffersWritten: u32,
Anonymous2: _Anonymous2_e__Union,
LoggerName: ?*anyopaque,
LogFileName: ?*anyopaque,
TimeZone: TIME_ZONE_INFORMATION,
BootTime: i64,
PerfFreq: i64,
StartTime: i64,
ReservedFlags: u32,
BuffersLost: u32,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
TIME_ZONE_INFORMATION {.bycopy.} = object
Bias: int32
StandardName: array[32, uint16]
StandardDate: SYSTEMTIME
StandardBias: int32
DaylightName: array[32, uint16]
DaylightDate: SYSTEMTIME
DaylightBias: int32
TRACE_LOGFILE_HEADER {.bycopy.} = object
BufferSize: uint32
Anonymous1: _Anonymous1_e__Union
ProviderVersion: uint32
NumberOfProcessors: uint32
EndTime: int64
TimerResolution: uint32
MaximumFileSize: uint32
LogFileMode: uint32
BuffersWritten: uint32
Anonymous2: _Anonymous2_e__Union
LoggerName: pointer
LogFileName: pointer
TimeZone: TIME_ZONE_INFORMATION
BootTime: int64
PerfFreq: int64
StartTime: int64
ReservedFlags: uint32
BuffersLost: uint32struct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct TIME_ZONE_INFORMATION
{
int Bias;
wchar[32] StandardName;
SYSTEMTIME StandardDate;
int StandardBias;
wchar[32] DaylightName;
SYSTEMTIME DaylightDate;
int DaylightBias;
}
struct TRACE_LOGFILE_HEADER
{
uint BufferSize;
_Anonymous1_e__Union Anonymous1;
uint ProviderVersion;
uint NumberOfProcessors;
long EndTime;
uint TimerResolution;
uint MaximumFileSize;
uint LogFileMode;
uint BuffersWritten;
_Anonymous2_e__Union Anonymous2;
void* LoggerName;
void* LogFileName;
TIME_ZONE_INFORMATION TimeZone;
long BootTime;
long PerfFreq;
long StartTime;
uint ReservedFlags;
uint BuffersLost;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TRACE_LOGFILE_HEADER サイズ: 272 バイト(x86)
dim st, 68 ; 4byte整数×68(構造体サイズ 272 / 4 切り上げ)
; BufferSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ProviderVersion : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; NumberOfProcessors : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; EndTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; TimerResolution : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; MaximumFileSize : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; LogFileMode : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; BuffersWritten : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Anonymous2 : _Anonymous2_e__Union (+40, 16byte) varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; LoggerName : LPWSTR (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; LogFileName : LPWSTR (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; TimeZone : TIME_ZONE_INFORMATION (+64, 172byte) varptr(st)+64 を基点に操作(172byte:入れ子/配列)
; BootTime : LONGLONG (+240, 8byte) qpoke st,240,値 / qpeek(st,240) ※IronHSPのみ。3.7/3.8は lpoke st,240,下位 : lpoke st,244,上位
; PerfFreq : LONGLONG (+248, 8byte) qpoke st,248,値 / qpeek(st,248) ※IronHSPのみ。3.7/3.8は lpoke st,248,下位 : lpoke st,252,上位
; StartTime : LONGLONG (+256, 8byte) qpoke st,256,値 / qpeek(st,256) ※IronHSPのみ。3.7/3.8は lpoke st,256,下位 : lpoke st,260,上位
; ReservedFlags : DWORD (+264, 4byte) st.66 = 値 / 値 = st.66 (lpoke/lpeek も可)
; BuffersLost : DWORD (+268, 4byte) st.67 = 値 / 値 = st.67 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRACE_LOGFILE_HEADER サイズ: 288 バイト(x64)
dim st, 72 ; 4byte整数×72(構造体サイズ 288 / 4 切り上げ)
; BufferSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ProviderVersion : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; NumberOfProcessors : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; EndTime : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; TimerResolution : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; MaximumFileSize : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; LogFileMode : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; BuffersWritten : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Anonymous2 : _Anonymous2_e__Union (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; LoggerName : LPWSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; LogFileName : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; TimeZone : TIME_ZONE_INFORMATION (+80, 172byte) varptr(st)+80 を基点に操作(172byte:入れ子/配列)
; BootTime : LONGLONG (+256, 8byte) qpoke st,256,値 / qpeek(st,256) ※IronHSPのみ。3.7/3.8は lpoke st,256,下位 : lpoke st,260,上位
; PerfFreq : LONGLONG (+264, 8byte) qpoke st,264,値 / qpeek(st,264) ※IronHSPのみ。3.7/3.8は lpoke st,264,下位 : lpoke st,268,上位
; StartTime : LONGLONG (+272, 8byte) qpoke st,272,値 / qpeek(st,272) ※IronHSPのみ。3.7/3.8は lpoke st,272,下位 : lpoke st,276,上位
; ReservedFlags : DWORD (+280, 4byte) st.70 = 値 / 値 = st.70 (lpoke/lpeek も可)
; BuffersLost : DWORD (+284, 4byte) st.71 = 値 / 値 = st.71 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
#defstruct global TIME_ZONE_INFORMATION
#field int Bias
#field wchar StandardName 32
#field SYSTEMTIME StandardDate
#field int StandardBias
#field wchar DaylightName 32
#field SYSTEMTIME DaylightDate
#field int DaylightBias
#endstruct
#defstruct global TRACE_LOGFILE_HEADER
#field int BufferSize
#field byte Anonymous1 8
#field int ProviderVersion
#field int NumberOfProcessors
#field int64 EndTime
#field int TimerResolution
#field int MaximumFileSize
#field int LogFileMode
#field int BuffersWritten
#field byte Anonymous2 16
#field intptr LoggerName
#field intptr LogFileName
#field TIME_ZONE_INFORMATION TimeZone
#field int64 BootTime
#field int64 PerfFreq
#field int64 StartTime
#field int ReservedFlags
#field int BuffersLost
#endstruct
stdim st, TRACE_LOGFILE_HEADER ; NSTRUCT 変数を確保
st->BufferSize = 100
mes "BufferSize=" + st->BufferSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。