ホーム › System.Diagnostics.Debug.Extensions › SYM_DUMP_PARAM
SYM_DUMP_PARAM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| size | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| sName | BYTE* | 8/4 | +8 | +4 | ダンプ対象の型名を表すASCII文字列へのポインタ。 |
| Options | DWORD | 4 | +16 | +8 | シンボルダンプ動作を制御するオプションフラグ(DBG_DUMP_*)。 |
| addr | ULONGLONG | 8 | +24 | +16 | ダンプ対象データのアドレス。 |
| listLink | FIELD_INFO* | 8/4 | +32 | +24 | リスト走査時の連結フィールド情報へのポインタ。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +40 | +28 | 出力バッファまたはコンテキストを保持する無名共用体。 |
| CallbackRoutine | PSYM_DUMP_FIELD_CALLBACK | 8/4 | +48 | +32 | 各フィールド処理時に呼ばれるコールバック関数へのポインタ。 |
| nFields | DWORD | 4 | +56 | +36 | Fields配列に含まれるフィールド数。 |
| Fields | FIELD_INFO* | 8/4 | +64 | +40 | ダンプ対象フィールド情報(FIELD_INFO)の配列へのポインタ。 |
| ModBase | ULONGLONG | 8 | +72 | +48 | 型が属するモジュールの基底アドレス(出力)。 |
| TypeId | DWORD | 4 | +80 | +56 | ダンプ対象の型を識別するID(出力)。 |
| TypeSize | DWORD | 4 | +84 | +60 | 対象型のバイトサイズ(出力)。 |
| BufferSize | DWORD | 4 | +88 | +64 | 出力バッファのサイズ。 |
| _bitfield | DWORD | 4 | +92 | +68 | 各種ビットフラグをまとめた領域。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Context | void* | 8/4 | +0 | +0 |
| pBuffer | void* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// SYM_DUMP_PARAM (x64 96 / x86 72 バイト)
typedef struct SYM_DUMP_PARAM {
DWORD size;
BYTE* sName;
DWORD Options;
ULONGLONG addr;
FIELD_INFO* listLink;
_Anonymous_e__Union Anonymous;
PSYM_DUMP_FIELD_CALLBACK CallbackRoutine;
DWORD nFields;
FIELD_INFO* Fields;
ULONGLONG ModBase;
DWORD TypeId;
DWORD TypeSize;
DWORD BufferSize;
DWORD _bitfield;
} SYM_DUMP_PARAM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYM_DUMP_PARAM
{
public uint size;
public IntPtr sName;
public uint Options;
public ulong addr;
public IntPtr listLink;
public _Anonymous_e__Union Anonymous;
public IntPtr CallbackRoutine;
public uint nFields;
public IntPtr Fields;
public ulong ModBase;
public uint TypeId;
public uint TypeSize;
public uint BufferSize;
public uint _bitfield;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYM_DUMP_PARAM
Public size As UInteger
Public sName As IntPtr
Public Options As UInteger
Public addr As ULong
Public listLink As IntPtr
Public Anonymous As _Anonymous_e__Union
Public CallbackRoutine As IntPtr
Public nFields As UInteger
Public Fields As IntPtr
Public ModBase As ULong
Public TypeId As UInteger
Public TypeSize As UInteger
Public BufferSize As UInteger
Public _bitfield As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SYM_DUMP_PARAM(ctypes.Structure):
_fields_ = [
("size", wintypes.DWORD),
("sName", ctypes.c_void_p),
("Options", wintypes.DWORD),
("addr", ctypes.c_ulonglong),
("listLink", ctypes.c_void_p),
("Anonymous", _Anonymous_e__Union),
("CallbackRoutine", ctypes.c_void_p),
("nFields", wintypes.DWORD),
("Fields", ctypes.c_void_p),
("ModBase", ctypes.c_ulonglong),
("TypeId", wintypes.DWORD),
("TypeSize", wintypes.DWORD),
("BufferSize", wintypes.DWORD),
("_bitfield", wintypes.DWORD),
]#[repr(C)]
pub struct SYM_DUMP_PARAM {
pub size: u32,
pub sName: *mut core::ffi::c_void,
pub Options: u32,
pub addr: u64,
pub listLink: *mut core::ffi::c_void,
pub Anonymous: _Anonymous_e__Union,
pub CallbackRoutine: *mut core::ffi::c_void,
pub nFields: u32,
pub Fields: *mut core::ffi::c_void,
pub ModBase: u64,
pub TypeId: u32,
pub TypeSize: u32,
pub BufferSize: u32,
pub _bitfield: u32,
}import "golang.org/x/sys/windows"
type SYM_DUMP_PARAM struct {
size uint32
sName uintptr
Options uint32
addr uint64
listLink uintptr
Anonymous _Anonymous_e__Union
CallbackRoutine uintptr
nFields uint32
Fields uintptr
ModBase uint64
TypeId uint32
TypeSize uint32
BufferSize uint32
_bitfield uint32
}type
SYM_DUMP_PARAM = record
size: DWORD;
sName: Pointer;
Options: DWORD;
addr: UInt64;
listLink: Pointer;
Anonymous: _Anonymous_e__Union;
CallbackRoutine: Pointer;
nFields: DWORD;
Fields: Pointer;
ModBase: UInt64;
TypeId: DWORD;
TypeSize: DWORD;
BufferSize: DWORD;
_bitfield: DWORD;
end;const SYM_DUMP_PARAM = extern struct {
size: u32,
sName: ?*anyopaque,
Options: u32,
addr: u64,
listLink: ?*anyopaque,
Anonymous: _Anonymous_e__Union,
CallbackRoutine: ?*anyopaque,
nFields: u32,
Fields: ?*anyopaque,
ModBase: u64,
TypeId: u32,
TypeSize: u32,
BufferSize: u32,
_bitfield: u32,
};type
SYM_DUMP_PARAM {.bycopy.} = object
size: uint32
sName: pointer
Options: uint32
addr: uint64
listLink: pointer
Anonymous: _Anonymous_e__Union
CallbackRoutine: pointer
nFields: uint32
Fields: pointer
ModBase: uint64
TypeId: uint32
TypeSize: uint32
BufferSize: uint32
_bitfield: uint32struct SYM_DUMP_PARAM
{
uint size;
void* sName;
uint Options;
ulong addr;
void* listLink;
_Anonymous_e__Union Anonymous;
void* CallbackRoutine;
uint nFields;
void* Fields;
ulong ModBase;
uint TypeId;
uint TypeSize;
uint BufferSize;
uint _bitfield;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SYM_DUMP_PARAM サイズ: 72 バイト(x86)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; sName : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Options : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; addr : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; listLink : FIELD_INFO* (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; CallbackRoutine : PSYM_DUMP_FIELD_CALLBACK (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; nFields : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Fields : FIELD_INFO* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; ModBase : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; TypeId : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; TypeSize : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; BufferSize : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; _bitfield : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYM_DUMP_PARAM サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; sName : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Options : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; addr : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; listLink : FIELD_INFO* (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; CallbackRoutine : PSYM_DUMP_FIELD_CALLBACK (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; nFields : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Fields : FIELD_INFO* (+64, 8byte) varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; ModBase : ULONGLONG (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; TypeId : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; TypeSize : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; BufferSize : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; _bitfield : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SYM_DUMP_PARAM
#field int size
#field intptr sName
#field int Options
#field int64 addr
#field intptr listLink
#field byte Anonymous 8
#field intptr CallbackRoutine
#field int nFields
#field intptr Fields
#field int64 ModBase
#field int TypeId
#field int TypeSize
#field int BufferSize
#field int _bitfield
#endstruct
stdim st, SYM_DUMP_PARAM ; NSTRUCT 変数を確保
st->size = 100
mes "size=" + st->size
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。