ホーム › System.Diagnostics.Debug.Extensions › FIELD_INFO
FIELD_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fName | BYTE* | 8/4 | +0 | +0 | 対象フィールド名を表すASCII文字列へのポインタ。 |
| printName | BYTE* | 8/4 | +8 | +4 | 表示用に整形したフィールド名へのポインタ。 |
| size | DWORD | 4 | +16 | +8 | フィールドのバイトサイズ(出力)。 |
| fOptions | DWORD | 4 | +20 | +12 | フィールドダンプ動作を制御するオプションフラグ(DBG_DUMP_FIELD_*)。 |
| address | ULONGLONG | 8 | +24 | +16 | フィールドのアドレス(出力)。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +32 | +24 | フィールド値またはコンテキストを保持する無名共用体。 |
| TypeId | DWORD | 4 | +40 | +28 | フィールドの型を識別するID(出力)。 |
| FieldOffset | DWORD | 4 | +44 | +32 | 親構造体内でのフィールドのオフセット(出力)。 |
| BufferSize | DWORD | 4 | +48 | +36 | 値を受け取るバッファのサイズ。 |
| BitField | _BitField | 4 | +52 | +40 | ビットフィールドの位置・幅情報。 |
| _bitfield | DWORD | 4 | +56 | +44 | fPointer/fArray等の各種ビットフラグをまとめた領域。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| fieldCallBack | void* | 8/4 | +0 | +0 |
| pBuffer | void* | 8/4 | +0 | +0 |
構造体: _BitField x64 4B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Position | WORD | 2 | +0 | +0 |
| Size | WORD | 2 | +2 | +2 |
各言語での定義
#include <windows.h>
// FIELD_INFO (x64 64 / x86 48 バイト)
typedef struct FIELD_INFO {
BYTE* fName;
BYTE* printName;
DWORD size;
DWORD fOptions;
ULONGLONG address;
_Anonymous_e__Union Anonymous;
DWORD TypeId;
DWORD FieldOffset;
DWORD BufferSize;
_BitField BitField;
DWORD _bitfield;
} FIELD_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FIELD_INFO
{
public IntPtr fName;
public IntPtr printName;
public uint size;
public uint fOptions;
public ulong address;
public _Anonymous_e__Union Anonymous;
public uint TypeId;
public uint FieldOffset;
public uint BufferSize;
public _BitField BitField;
public uint _bitfield;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FIELD_INFO
Public fName As IntPtr
Public printName As IntPtr
Public size As UInteger
Public fOptions As UInteger
Public address As ULong
Public Anonymous As _Anonymous_e__Union
Public TypeId As UInteger
Public FieldOffset As UInteger
Public BufferSize As UInteger
Public BitField As _BitField
Public _bitfield As UInteger
End Structureimport ctypes
from ctypes import wintypes
class FIELD_INFO(ctypes.Structure):
_fields_ = [
("fName", ctypes.c_void_p),
("printName", ctypes.c_void_p),
("size", wintypes.DWORD),
("fOptions", wintypes.DWORD),
("address", ctypes.c_ulonglong),
("Anonymous", _Anonymous_e__Union),
("TypeId", wintypes.DWORD),
("FieldOffset", wintypes.DWORD),
("BufferSize", wintypes.DWORD),
("BitField", _BitField),
("_bitfield", wintypes.DWORD),
]#[repr(C)]
pub struct FIELD_INFO {
pub fName: *mut core::ffi::c_void,
pub printName: *mut core::ffi::c_void,
pub size: u32,
pub fOptions: u32,
pub address: u64,
pub Anonymous: _Anonymous_e__Union,
pub TypeId: u32,
pub FieldOffset: u32,
pub BufferSize: u32,
pub BitField: _BitField,
pub _bitfield: u32,
}import "golang.org/x/sys/windows"
type FIELD_INFO struct {
fName uintptr
printName uintptr
size uint32
fOptions uint32
address uint64
Anonymous _Anonymous_e__Union
TypeId uint32
FieldOffset uint32
BufferSize uint32
BitField _BitField
_bitfield uint32
}type
FIELD_INFO = record
fName: Pointer;
printName: Pointer;
size: DWORD;
fOptions: DWORD;
address: UInt64;
Anonymous: _Anonymous_e__Union;
TypeId: DWORD;
FieldOffset: DWORD;
BufferSize: DWORD;
BitField: _BitField;
_bitfield: DWORD;
end;const FIELD_INFO = extern struct {
fName: ?*anyopaque,
printName: ?*anyopaque,
size: u32,
fOptions: u32,
address: u64,
Anonymous: _Anonymous_e__Union,
TypeId: u32,
FieldOffset: u32,
BufferSize: u32,
BitField: _BitField,
_bitfield: u32,
};type
FIELD_INFO {.bycopy.} = object
fName: pointer
printName: pointer
size: uint32
fOptions: uint32
address: uint64
Anonymous: _Anonymous_e__Union
TypeId: uint32
FieldOffset: uint32
BufferSize: uint32
BitField: _BitField
_bitfield: uint32struct FIELD_INFO
{
void* fName;
void* printName;
uint size;
uint fOptions;
ulong address;
_Anonymous_e__Union Anonymous;
uint TypeId;
uint FieldOffset;
uint BufferSize;
_BitField BitField;
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 レイアウト)
; FIELD_INFO サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; fName : BYTE* (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; printName : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; size : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fOptions : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; address : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Anonymous : _Anonymous_e__Union (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; TypeId : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; FieldOffset : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; BufferSize : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; BitField : _BitField (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; _bitfield : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FIELD_INFO サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; fName : BYTE* (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; printName : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; size : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fOptions : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; address : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Anonymous : _Anonymous_e__Union (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; TypeId : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; FieldOffset : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; BufferSize : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; BitField : _BitField (+52, 4byte) varptr(st)+52 を基点に操作(4byte:入れ子/配列)
; _bitfield : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FIELD_INFO
#field intptr fName
#field intptr printName
#field int size
#field int fOptions
#field int64 address
#field byte Anonymous 8
#field int TypeId
#field int FieldOffset
#field int BufferSize
#field _BitField BitField
#field int _bitfield
#endstruct
stdim st, FIELD_INFO ; NSTRUCT 変数を確保
st->size = 100
mes "size=" + st->size
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。