ホーム › System.Diagnostics.Debug.Extensions › EXT_TYPED_DATA
EXT_TYPED_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Operation | EXT_TDOP | 4 | +0 | +0 | 実行する型付きデータ操作(EXT_TDOP)を示す。 |
| Flags | DWORD | 4 | +4 | +4 | 操作の動作を制御するフラグ。 |
| InData | DEBUG_TYPED_DATA | 128 | +8 | +8 | 操作の入力となる型付きデータ。 |
| OutData | DEBUG_TYPED_DATA | 128 | +136 | +136 | 操作の結果となる型付きデータ(出力)。 |
| InStrIndex | DWORD | 4 | +264 | +264 | 入力文字列バッファ内のインデックス。 |
| In32 | DWORD | 4 | +268 | +268 | 操作種別に応じた32ビット入力値。 |
| Out32 | DWORD | 4 | +272 | +272 | 操作種別に応じた32ビット出力値。 |
| In64 | ULONGLONG | 8 | +280 | +280 | 操作種別に応じた64ビット入力値。 |
| Out64 | ULONGLONG | 8 | +288 | +288 | 操作種別に応じた64ビット出力値。 |
| StrBufferIndex | DWORD | 4 | +296 | +296 | 文字列バッファ内の出力先インデックス。 |
| StrBufferChars | DWORD | 4 | +300 | +300 | 文字列バッファの容量(文字数)。 |
| StrCharsNeeded | DWORD | 4 | +304 | +304 | 出力に必要な文字数(出力)。 |
| DataBufferIndex | DWORD | 4 | +308 | +308 | データバッファ内のインデックス。 |
| DataBufferBytes | DWORD | 4 | +312 | +312 | データバッファの容量(バイト数)。 |
| DataBytesNeeded | DWORD | 4 | +316 | +316 | 出力に必要なバイト数(出力)。 |
| Status | HRESULT | 4 | +320 | +320 | 操作の結果を示すHRESULT。 |
| Reserved | ULONGLONG | 64 | +328 | +328 | 予約フィールド。0が設定される。 |
各言語での定義
#include <windows.h>
// DEBUG_TYPED_DATA (x64 128 / x86 128 バイト)
typedef struct DEBUG_TYPED_DATA {
ULONGLONG ModBase;
ULONGLONG Offset;
ULONGLONG EngineHandle;
ULONGLONG Data;
DWORD Size;
DWORD Flags;
DWORD TypeId;
DWORD BaseTypeId;
DWORD Tag;
DWORD Register;
ULONGLONG Internal[9];
} DEBUG_TYPED_DATA;
// EXT_TYPED_DATA (x64 392 / x86 392 バイト)
typedef struct EXT_TYPED_DATA {
EXT_TDOP Operation;
DWORD Flags;
DEBUG_TYPED_DATA InData;
DEBUG_TYPED_DATA OutData;
DWORD InStrIndex;
DWORD In32;
DWORD Out32;
ULONGLONG In64;
ULONGLONG Out64;
DWORD StrBufferIndex;
DWORD StrBufferChars;
DWORD StrCharsNeeded;
DWORD DataBufferIndex;
DWORD DataBufferBytes;
DWORD DataBytesNeeded;
HRESULT Status;
ULONGLONG Reserved[8];
} EXT_TYPED_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_TYPED_DATA
{
public ulong ModBase;
public ulong Offset;
public ulong EngineHandle;
public ulong Data;
public uint Size;
public uint Flags;
public uint TypeId;
public uint BaseTypeId;
public uint Tag;
public uint Register;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)] public ulong[] Internal;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EXT_TYPED_DATA
{
public int Operation;
public uint Flags;
public DEBUG_TYPED_DATA InData;
public DEBUG_TYPED_DATA OutData;
public uint InStrIndex;
public uint In32;
public uint Out32;
public ulong In64;
public ulong Out64;
public uint StrBufferIndex;
public uint StrBufferChars;
public uint StrCharsNeeded;
public uint DataBufferIndex;
public uint DataBufferBytes;
public uint DataBytesNeeded;
public int Status;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public ulong[] Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_TYPED_DATA
Public ModBase As ULong
Public Offset As ULong
Public EngineHandle As ULong
Public Data As ULong
Public Size As UInteger
Public Flags As UInteger
Public TypeId As UInteger
Public BaseTypeId As UInteger
Public Tag As UInteger
Public Register As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=9)> Public Internal() As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EXT_TYPED_DATA
Public Operation As Integer
Public Flags As UInteger
Public InData As DEBUG_TYPED_DATA
Public OutData As DEBUG_TYPED_DATA
Public InStrIndex As UInteger
Public In32 As UInteger
Public Out32 As UInteger
Public In64 As ULong
Public Out64 As ULong
Public StrBufferIndex As UInteger
Public StrBufferChars As UInteger
Public StrCharsNeeded As UInteger
Public DataBufferIndex As UInteger
Public DataBufferBytes As UInteger
Public DataBytesNeeded As UInteger
Public Status As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public Reserved() As ULong
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_TYPED_DATA(ctypes.Structure):
_fields_ = [
("ModBase", ctypes.c_ulonglong),
("Offset", ctypes.c_ulonglong),
("EngineHandle", ctypes.c_ulonglong),
("Data", ctypes.c_ulonglong),
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("TypeId", wintypes.DWORD),
("BaseTypeId", wintypes.DWORD),
("Tag", wintypes.DWORD),
("Register", wintypes.DWORD),
("Internal", ctypes.c_ulonglong * 9),
]
class EXT_TYPED_DATA(ctypes.Structure):
_fields_ = [
("Operation", ctypes.c_int),
("Flags", wintypes.DWORD),
("InData", DEBUG_TYPED_DATA),
("OutData", DEBUG_TYPED_DATA),
("InStrIndex", wintypes.DWORD),
("In32", wintypes.DWORD),
("Out32", wintypes.DWORD),
("In64", ctypes.c_ulonglong),
("Out64", ctypes.c_ulonglong),
("StrBufferIndex", wintypes.DWORD),
("StrBufferChars", wintypes.DWORD),
("StrCharsNeeded", wintypes.DWORD),
("DataBufferIndex", wintypes.DWORD),
("DataBufferBytes", wintypes.DWORD),
("DataBytesNeeded", wintypes.DWORD),
("Status", ctypes.c_int),
("Reserved", ctypes.c_ulonglong * 8),
]#[repr(C)]
pub struct DEBUG_TYPED_DATA {
pub ModBase: u64,
pub Offset: u64,
pub EngineHandle: u64,
pub Data: u64,
pub Size: u32,
pub Flags: u32,
pub TypeId: u32,
pub BaseTypeId: u32,
pub Tag: u32,
pub Register: u32,
pub Internal: [u64; 9],
}
#[repr(C)]
pub struct EXT_TYPED_DATA {
pub Operation: i32,
pub Flags: u32,
pub InData: DEBUG_TYPED_DATA,
pub OutData: DEBUG_TYPED_DATA,
pub InStrIndex: u32,
pub In32: u32,
pub Out32: u32,
pub In64: u64,
pub Out64: u64,
pub StrBufferIndex: u32,
pub StrBufferChars: u32,
pub StrCharsNeeded: u32,
pub DataBufferIndex: u32,
pub DataBufferBytes: u32,
pub DataBytesNeeded: u32,
pub Status: i32,
pub Reserved: [u64; 8],
}import "golang.org/x/sys/windows"
type DEBUG_TYPED_DATA struct {
ModBase uint64
Offset uint64
EngineHandle uint64
Data uint64
Size uint32
Flags uint32
TypeId uint32
BaseTypeId uint32
Tag uint32
Register uint32
Internal [9]uint64
}
type EXT_TYPED_DATA struct {
Operation int32
Flags uint32
InData DEBUG_TYPED_DATA
OutData DEBUG_TYPED_DATA
InStrIndex uint32
In32 uint32
Out32 uint32
In64 uint64
Out64 uint64
StrBufferIndex uint32
StrBufferChars uint32
StrCharsNeeded uint32
DataBufferIndex uint32
DataBufferBytes uint32
DataBytesNeeded uint32
Status int32
Reserved [8]uint64
}type
DEBUG_TYPED_DATA = record
ModBase: UInt64;
Offset: UInt64;
EngineHandle: UInt64;
Data: UInt64;
Size: DWORD;
Flags: DWORD;
TypeId: DWORD;
BaseTypeId: DWORD;
Tag: DWORD;
Register: DWORD;
Internal: array[0..8] of UInt64;
end;
EXT_TYPED_DATA = record
Operation: Integer;
Flags: DWORD;
InData: DEBUG_TYPED_DATA;
OutData: DEBUG_TYPED_DATA;
InStrIndex: DWORD;
In32: DWORD;
Out32: DWORD;
In64: UInt64;
Out64: UInt64;
StrBufferIndex: DWORD;
StrBufferChars: DWORD;
StrCharsNeeded: DWORD;
DataBufferIndex: DWORD;
DataBufferBytes: DWORD;
DataBytesNeeded: DWORD;
Status: Integer;
Reserved: array[0..7] of UInt64;
end;const DEBUG_TYPED_DATA = extern struct {
ModBase: u64,
Offset: u64,
EngineHandle: u64,
Data: u64,
Size: u32,
Flags: u32,
TypeId: u32,
BaseTypeId: u32,
Tag: u32,
Register: u32,
Internal: [9]u64,
};
const EXT_TYPED_DATA = extern struct {
Operation: i32,
Flags: u32,
InData: DEBUG_TYPED_DATA,
OutData: DEBUG_TYPED_DATA,
InStrIndex: u32,
In32: u32,
Out32: u32,
In64: u64,
Out64: u64,
StrBufferIndex: u32,
StrBufferChars: u32,
StrCharsNeeded: u32,
DataBufferIndex: u32,
DataBufferBytes: u32,
DataBytesNeeded: u32,
Status: i32,
Reserved: [8]u64,
};type
DEBUG_TYPED_DATA {.bycopy.} = object
ModBase: uint64
Offset: uint64
EngineHandle: uint64
Data: uint64
Size: uint32
Flags: uint32
TypeId: uint32
BaseTypeId: uint32
Tag: uint32
Register: uint32
Internal: array[9, uint64]
EXT_TYPED_DATA {.bycopy.} = object
Operation: int32
Flags: uint32
InData: DEBUG_TYPED_DATA
OutData: DEBUG_TYPED_DATA
InStrIndex: uint32
In32: uint32
Out32: uint32
In64: uint64
Out64: uint64
StrBufferIndex: uint32
StrBufferChars: uint32
StrCharsNeeded: uint32
DataBufferIndex: uint32
DataBufferBytes: uint32
DataBytesNeeded: uint32
Status: int32
Reserved: array[8, uint64]struct DEBUG_TYPED_DATA
{
ulong ModBase;
ulong Offset;
ulong EngineHandle;
ulong Data;
uint Size;
uint Flags;
uint TypeId;
uint BaseTypeId;
uint Tag;
uint Register;
ulong[9] Internal;
}
struct EXT_TYPED_DATA
{
int Operation;
uint Flags;
DEBUG_TYPED_DATA InData;
DEBUG_TYPED_DATA OutData;
uint InStrIndex;
uint In32;
uint Out32;
ulong In64;
ulong Out64;
uint StrBufferIndex;
uint StrBufferChars;
uint StrCharsNeeded;
uint DataBufferIndex;
uint DataBufferBytes;
uint DataBytesNeeded;
int Status;
ulong[8] Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EXT_TYPED_DATA サイズ: 392 バイト(x64)
dim st, 98 ; 4byte整数×98(構造体サイズ 392 / 4 切り上げ)
; Operation : EXT_TDOP (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; InData : DEBUG_TYPED_DATA (+8, 128byte) varptr(st)+8 を基点に操作(128byte:入れ子/配列)
; OutData : DEBUG_TYPED_DATA (+136, 128byte) varptr(st)+136 を基点に操作(128byte:入れ子/配列)
; InStrIndex : DWORD (+264, 4byte) st.66 = 値 / 値 = st.66 (lpoke/lpeek も可)
; In32 : DWORD (+268, 4byte) st.67 = 値 / 値 = st.67 (lpoke/lpeek も可)
; Out32 : DWORD (+272, 4byte) st.68 = 値 / 値 = st.68 (lpoke/lpeek も可)
; In64 : ULONGLONG (+280, 8byte) qpoke st,280,値 / qpeek(st,280) ※IronHSPのみ。3.7/3.8は lpoke st,280,下位 : lpoke st,284,上位
; Out64 : ULONGLONG (+288, 8byte) qpoke st,288,値 / qpeek(st,288) ※IronHSPのみ。3.7/3.8は lpoke st,288,下位 : lpoke st,292,上位
; StrBufferIndex : DWORD (+296, 4byte) st.74 = 値 / 値 = st.74 (lpoke/lpeek も可)
; StrBufferChars : DWORD (+300, 4byte) st.75 = 値 / 値 = st.75 (lpoke/lpeek も可)
; StrCharsNeeded : DWORD (+304, 4byte) st.76 = 値 / 値 = st.76 (lpoke/lpeek も可)
; DataBufferIndex : DWORD (+308, 4byte) st.77 = 値 / 値 = st.77 (lpoke/lpeek も可)
; DataBufferBytes : DWORD (+312, 4byte) st.78 = 値 / 値 = st.78 (lpoke/lpeek も可)
; DataBytesNeeded : DWORD (+316, 4byte) st.79 = 値 / 値 = st.79 (lpoke/lpeek も可)
; Status : HRESULT (+320, 4byte) st.80 = 値 / 値 = st.80 (lpoke/lpeek も可)
; Reserved : ULONGLONG (+328, 64byte) varptr(st)+328 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DEBUG_TYPED_DATA
#field int64 ModBase
#field int64 Offset
#field int64 EngineHandle
#field int64 Data
#field int Size
#field int Flags
#field int TypeId
#field int BaseTypeId
#field int Tag
#field int Register
#field int64 Internal 9
#endstruct
#defstruct global EXT_TYPED_DATA
#field int Operation
#field int Flags
#field DEBUG_TYPED_DATA InData
#field DEBUG_TYPED_DATA OutData
#field int InStrIndex
#field int In32
#field int Out32
#field int64 In64
#field int64 Out64
#field int StrBufferIndex
#field int StrBufferChars
#field int StrCharsNeeded
#field int DataBufferIndex
#field int DataBufferBytes
#field int DataBytesNeeded
#field int Status
#field int64 Reserved 8
#endstruct
stdim st, EXT_TYPED_DATA ; NSTRUCT 変数を確保
st->Operation = 100
mes "Operation=" + st->Operation