ホーム › System.Diagnostics.Debug.Extensions › DEBUG_VALUE
DEBUG_VALUE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Anonymous | _Anonymous_e__Union | 24 | +0 | +0 | 整数/浮動小数点/ベクタなど各種型の値を保持する無名共用体。 |
| TailOfRawBytes | DWORD | 4 | +24 | +24 | RawBytes末尾の未使用バイト数を示す。 |
| Type | DWORD | 4 | +28 | +28 | 格納されている値の型(DEBUG_VALUE_*)を示す。 |
共用体: _Anonymous_e__Union x64 24B / x86 24B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| I8 | BYTE | 1 | +0 | +0 | |
| I16 | WORD | 2 | +0 | +0 | |
| I32 | DWORD | 4 | +0 | +0 | |
| Anonymous | _Anonymous_e__Struct | 8/4 | +0 | +0 | 整数/浮動小数点/ベクタなど各種型の値を保持する無名共用体。 |
| F32 | FLOAT | 4 | +0 | +0 | |
| F64 | DOUBLE | 8 | +0 | +0 | |
| F80Bytes | BYTE | 10 | +0 | +0 | |
| F82Bytes | BYTE | 11 | +0 | +0 | |
| F128Bytes | BYTE | 16 | +0 | +0 | |
| VI8 | BYTE | 16 | +0 | +0 | |
| VI16 | WORD | 16 | +0 | +0 | |
| VI32 | DWORD | 16 | +0 | +0 | |
| VI64 | ULONGLONG | 16 | +0 | +0 | |
| VF32 | FLOAT | 16 | +0 | +0 | |
| VF64 | DOUBLE | 16 | +0 | +0 | |
| I64Parts32 | _I64Parts32_e__Struct | 8/4 | +0 | +0 | |
| F128Parts64 | _F128Parts64_e__Struct | 8/4 | +0 | +0 | |
| RawBytes | BYTE | 24 | +0 | +0 |
各言語での定義
#include <windows.h>
// DEBUG_VALUE (x64 32 / x86 32 バイト)
typedef struct DEBUG_VALUE {
_Anonymous_e__Union Anonymous;
DWORD TailOfRawBytes;
DWORD Type;
} DEBUG_VALUE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_VALUE
{
public _Anonymous_e__Union Anonymous;
public uint TailOfRawBytes;
public uint Type;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_VALUE
Public Anonymous As _Anonymous_e__Union
Public TailOfRawBytes As UInteger
Public Type As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_VALUE(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Union),
("TailOfRawBytes", wintypes.DWORD),
("Type", wintypes.DWORD),
]#[repr(C)]
pub struct DEBUG_VALUE {
pub Anonymous: _Anonymous_e__Union,
pub TailOfRawBytes: u32,
pub Type: u32,
}import "golang.org/x/sys/windows"
type DEBUG_VALUE struct {
Anonymous _Anonymous_e__Union
TailOfRawBytes uint32
Type uint32
}type
DEBUG_VALUE = record
Anonymous: _Anonymous_e__Union;
TailOfRawBytes: DWORD;
Type: DWORD;
end;const DEBUG_VALUE = extern struct {
Anonymous: _Anonymous_e__Union,
TailOfRawBytes: u32,
Type: u32,
};type
DEBUG_VALUE {.bycopy.} = object
Anonymous: _Anonymous_e__Union
TailOfRawBytes: uint32
Type: uint32struct DEBUG_VALUE
{
_Anonymous_e__Union Anonymous;
uint TailOfRawBytes;
uint Type;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_VALUE サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Anonymous : _Anonymous_e__Union (+0, 24byte) varptr(st)+0 を基点に操作(24byte:入れ子/配列)
; TailOfRawBytes : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Type : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_VALUE
#field byte Anonymous 24
#field int TailOfRawBytes
#field int Type
#endstruct
stdim st, DEBUG_VALUE ; NSTRUCT 変数を確保
st->TailOfRawBytes = 100
mes "TailOfRawBytes=" + st->TailOfRawBytes
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。